6

I have several projects made in Visual Studio 2010, those projects are ArcGIS Desktop Add-in's. I have been change of computer, and my new one only have Visual Studio 2013 due to some company politics I'm not allowed to install VS2010.

I tried to open this projects in VS2013, and they open with no problem, but when i try to compile it, it get me the following issue:

ESRI.ArcGIS.AddIns.SDK, Version=10.2.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86. Could not load file or assembly 'Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the 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.

my research so far has get me to install the VS SDK, but I'm not quite sure about which one(2008...2013)

Any one has any possible solution for this?

  • Digging in the error, I arrive to the C:\Program Files (x86)\MSBuild\Esri\ESRI.ArcGIS.AddIns.targets, it calls some tasks from ESRI.ArcGIS.AddIns.SDK.dll, but I don't get which is the difference, between VS2010 and VS2013....does they use different MSBuild versions? – XtianGIS Sep 23 '14 at 2:33
4

First, I check that Microsoft.VisualStudio.Shell.9.0 was in the GAC, It was not there... :( then I proceed as Juho Vainio in Geonet suggest : Visual Studio Command Prompt --> Run as Administrator --> gacutil /i Microsoft.VisualStudio.Shell.9.0.dll, but it failed because I was not giving the full pat of the dll, so I search for it in the Visual Studio 2008 SDK, and Voila!!! it appear in the GAC enter image description here

but the project still does not compile, so, I chec in the real GAC:

C:\Windows\Microsoft.NET\assembly

and found that the file does not exist neither in the GAC_32, nor GAC_64 folder, moreover, it exists in the folder GAC_MSIL, so....i took the folder C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.9.0 and copied it to the folders GAC_32 and GAC_64.

Now the project compiles.

4

Here's an additional answer since I just went through this process with ArcGIS 10.3 and Visual Studio 2015. I'll just paste the reply I posted at https://geonet.esri.com/message/579779#579779. There are several steps, but none of them are too difficult.

First, to get the SDK installed, you need to add a few registry keys so that ArcGIS thinks that you have a supported version of Visual Studio installed.

  1. Add registry string value:

    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\12.0\InstallDir
    

    (or whatever version the SDK installer is looking for) and set it to:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\
    

    (or whatever version of Visual Studio you are trying to use).

  2. Add registry string value:

    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\12.0\ShellFolder  
    

    (or whatever version the SDK installer is looking for) and set it to:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\
    

    (or whatever version of Visual Studio you are trying to use).

Second, if you're working with an existing project created for/with an older version of ArcGIS and Visual Studio and creating an add-in, you may need to edit the project file that builds the add-in to correct part of its build task. More on this at http://support.esri.com/en/knowledgebase/techarticles/detail/45263.

  1. Change

    <Import Project="$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.targets" Condition="Exists('$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.targets')" />
    

    to

    <Import Project="$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.11.targets" Condition="Exists('$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.11.targets')" />
    

    and change

    <Warning Text="Unable to create .esriAddin; missing ESRI ArcGIS Add-in SDK component(s)." Condition="!Exists('$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.targets')" />
    

    to

    <Warning Text="Unable to create .esriAddin; missing ESRI ArcGIS Add-in SDK component(s)." Condition="!Exists('$(MSBuildExtensionsPath)\ESRI\ESRI.ArcGIS.AddIns.11.targets')" />.
    

    Alternatively, you can copy and rename the existing ESRI.ArcGIS.AddIns.targets file to ESRI.ArcGIS.AddIns.11.targets. The MSBuildExtensionsPath is located in your Program Files (x86) directory.

Third, if you're building an add-in, you need to edit the .targets file from the previous step to look for the version of Visual Studio you are trying to use.

  1. In

    C:\Program Files (x86)\MSBuild\Esri\ESRI.ArcGIS.AddIns.11.targets
    

    change

    <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'" />
    

    to

    <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'" />
    

    Alternatively, you can simply remove the Condition="'$(VisualStudioVersion)' == '12.0'" from these entries.

Fourth and finally, you need a copy of the Visual Studio 2013 shell registered in the GAC. I was able to copy this from another machine (it was located at C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.12.0), but if you don't have access to a machine with VS2013 installed you can download the Visual Studio 2013 SDK from https://www.microsoft.com/en-us/download/details.aspx?id=40758 and copy it from there.

  1. Find a copy of the Microsoft.VisualStudio.Shell.12.0.dll for Visual Studio 2013 and copy it to your machine. Register it in the GAC using an elevated command prompt by entering gacutil /i Microsoft.VisualStudio.Shell.12.0.dll from the location you copied the file to on your machine. Note that you will now have two versions of this file in the GAC, one from Visual Studio 2013 and one from Visual Studio 2015. This can be seen by entering gacutil /l from the command prompt to list all of the entries in the GAC. My entries look like:

    Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Microsoft.VisualStudio.Shell.12.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    

Hope that helps some others.

Shea

2

These are the steps I followed multiple times to get addins working in versions of visual studio other than 2010, using the 10.2.2 arcobjects sdk. My guess is this would probably work with 10.1 as well.

  1. Install the version of visual studio you wish to use
  2. Install visual studio 2010 and ArcMap 10.2.2 (requirements for arcobjects 10.2.2)
  3. Install ArcObjects SDK (10.2.2 is the version I used)
  4. Install Visual Studio SDK 2010 http://www.microsoft.com/en-us/download/details.aspx?id=2680
  5. Run Visual Studio command prompt as administrator

    a. cd "C:\Program Files (x86)\Microsoft Visual Studio 2010 SDK\VisualStudioIntegration\Common\Assemblies\v2.0"

    b. gacutil /i Microsoft.VisualStudio.Shell.9.0.dll

  6. Build the addin (visual studio must be restarted if you had it open) Success

1

Visual Studio 2013 does not support ArcObjects SDK. I know it sucks. You can however force VS2013 to build an AddIn project if you have a copy of the files below:

  1. Copy ESRI.ArcGIS.AddIns.targets to C:\Program Files\MSBuild\ESRI
  2. ESRI.ArcGIS.AddIns.SDK.dll needs to be added to assembly cache using gacutil.exe

Can't remember where I got this info or how exactly I did it, but it works now for me.

  • I already have the targets file in the location that you point, also the ESRI.ArcGIS.AddIns.SDK.dll is in the GAC. Is there any difference if I use gacutil.exe? – XtianGIS Sep 23 '14 at 17:18
0

I had a similar issue and I have solved it using devenv.exe instead of msbuild.exe as described in Building ArcMap’s Add-in using command line

0

If Visual Studio 2013 and 2015 are both installed on the machine, this problem does not occur. Visual Studio 2013 includes the Microsoft Visual Studio Shell 12.0 library. To resolve this issue, download and install the Microsoft Visual Studio 2013 Shell (Isolated) redistributable Package.

You can see on support Esri http://support.esri.com/technical-article/000012659

  • Will this solution allow you to use ArcGIS 10.3.1 ArcObjects SDK with Visual Studio 2015? – Rich Wawrzonek Sep 8 '16 at 17:51

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.