4

I'm running a simple ArcMap add-in in Visual Studio and am getting this error:

Severity Code Description Project File Line Suppression State Error The "ValidateAddInXMLTask" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at ESRI.ArcGIS.AddIns.SDK.MSBuild.ValidateAddInXMLTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. FirstAddIn

I'm using ArcGIS for Desktop and ArcObjects SDK for .NET version 10.4. I obtained my Arc license and SDK via ISO on MyEsri and for this add-in I'm using .NET 4.5.

My issue seems very similar to this one as I also got the same dialog box pictured there, but in the accepted answer it has me check Use Managed Compatibility Mode and it was grayed out when I tried it. I also had no luck with the other answers. I'm new to Visual Studio.

4

To quote this thread, Visual Studio 2015 "will install correctly, and create projects, but will not allow you to build a project without having VS2013 installed as well."

  • As goofy as it sounds, this works. All you need to do is install (or reinstall) VS 2013 and it will build successfully in VS 2015. Hello, ArcGIS! – Leta Rogers Jun 3 '16 at 5:17
  • 3
    An update to this thread states a workaround here (Download and install the Microsoft Visual Studio 2013 Shell (Isolated) redistributable Package.) – Jason Miller Jun 19 '16 at 20:16
  • 1
    @JasonMiller the 2013 redistributable download from Microsoft in your link no longer exists. I was only able to find a download Here and even then I had to rename the downloaded exe to "vssdk_full.exe" before it would even work – John Grabanski Oct 9 '17 at 18:54
  • Changing Version=10.X.0.0 to Version=10.6.0.0 in C:\Program Files (x86)\MSBuild\Esri\ESRI.ArcGIS.AddIns.11.targets works without having to run both versions of VS 2013 on the same machine – Jakub Sisak GeoGraphics Mar 13 '18 at 14:27
1

I figure some people might don't want to install 2013 along side 2015, this is another simpler workaround that worked for me..

ValidateAddinXmlTask is not that important if you know your XML is good. The easiest thing to do is comment it out in your targets file. enter image description here enter image description here

  • This is where I went, and it avoided the issue (note that it didn't fix the problem, just ignores the validation errors by not running XML validation.) – JasonInVegas Apr 4 '18 at 20:42
1

When rebuilding an existing ArcMap add-in, I got a similar error after upgrading from ArcGIS 10.4.1 to 10.5.1:

The "ValidateAddInXMLTask" task could not be loaded from the assembly ESRI.ArcGIS.AddInMsBuild.SDK,
Version=10.4.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86. Could not load file or assembly 'ESRI.ArcGIS.AddInMsBuild.SDK,
Version=10.4.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86' or one of its dependencies.
The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct,
that the assembly and all its dependencies are available, and that the task contains a public class
that implements Microsoft.Build.Framework.ITask.

Thanks to the helpful responses above, I was able to fix this by changing Version=10.4.0.0 to Version=10.5.0.0 in C:\Program Files (x86)\MSBuild\Esri\ESRI.ArcGIS.AddIns.11.targets.

As alluded to here and in other responses, there are two things to consider: the ArcGIS version, specified in the Version tag and the Visual Studio version, specified in the Condition tag. After I posted my message I built my project in Visual Studio 2012 Express and got the ValidateAddInXMLTask error again. But, adding lines for ArcGIS Version 10.5 and Visual Studio version 11.0 fixed the problem.

1

I can't solve the problem, but according to ESRI support "ArcObjects 10.3 does not officially support Visual Studio 2015. It only supports VS 2012 and 2013" from https://geonet.esri.com/thread/120636, but according to another user in that thread you can make it work.

I'm not sure but there is usually a lag between the latest VS and ESRI SDK releases. For what it's worth apparently ESRI has developed compatibility for VS 2015 and ArcGIS Pro https://blogs.esri.com/esri/arcgis/2015/09/08/visual-studio-2015-support-now-available-for-the-arcgis-pro-1-1-sdk-for-net/.

  • ArcObjects SDK 10.4 requires either VS 2013 or VS 2015, so should be OK here. See ArcObjects SDK 10.4 System Requirements – Midavalo Feb 28 '16 at 7:22
  • Whoops, I somehow missed that the OP was using 10.4, I didn't realize that was even released. Thanks for pointing that out. – Dave-Evans Feb 28 '16 at 16:25
0

If you can get hold of a Microsoft.VisualStudio.Shell.12.0.dll somehow, maybe from an older installation, you can use this dll instead of installing VisualStudio2013 completely. I just solved the problem with registering it to the GAC with those steps:

  1. Place the Microsoft.VisualStudio.Shell.12.0.dll and its dependencies in an appropriate directory.
  2. Open the command line as admin.
  3. Go to the directory holding the gacutil.exe, often found in a place like C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools.
  4. Add the assembly to the GAC with the command gacutil.exe /i D:\WhereEver\Microsoft.VisualStudio.Shell.12.0.dll.
0

I was able to build my 10.3.1 AddIn in Visual Studio 2015 by doing the following:

  1. Open the ESRI.ArcGIS.AddIns.11.targets file in a text editor (in my case, the file is located: C:\Program Files (x86)\MSBuild\Esri\ESRI.ArcGIS.AddIns.11.targets).

  2. Copy the block of Custom Build tasks:
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="PackageAddIn" Condition="'$(VisualStudioVersion)' == '12.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ValidateAddInXMLTask" Condition="'$(VisualStudioVersion)' == '12.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ConvertToRelativePath" Condition="'$(VisualStudioVersion)' == '12.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ResolveAddInReference" Condition="'$(VisualStudioVersion)' == '12.0'" />

  3. Paste them immediately below and change the Condition="'$(VisualStudioVersion)' == '14.0'" value from 12.0 to 14.0. <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="PackageAddIn" Condition="'$(VisualStudioVersion)' == '14.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ValidateAddInXMLTask" Condition="'$(VisualStudioVersion)' == '14.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ConvertToRelativePath" Condition="'$(VisualStudioVersion)' == '14.0'" />
    <UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK.12, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ResolveAddInReference" Condition="'$(VisualStudioVersion)' == '14.0'" />
  • My targets file already has both the 12.0 and 14.0 lines, but I'm getting the issue anyway. – Tom May 4 '17 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.