ArcObjects 10.2 SDK and Visual Studio

17209
6
01-27-2015 08:14 AM
BBulla
by
Occasional Contributor

Hi,

Does anyone know how to get the SDK to install in VS 2013 or more recent?  Is there a 'back door' way to get it to work?

VS 2012 seems to be a hard thing to find, and Microsoft will not sell us a licence for the trial version we have downloaded.  So after my 60-day trial I will need to find an alternative to getting the SDK to work

Any advice is appreciated.

Thanks,

0 Kudos
6 Replies
PhelixJangu
New Contributor

Hello Bulla,

Did you work out this? I had Visual Studio 2013 Ultimate, ArcGIS 10.3 and ArcObjects 10.3, everything seemed to work okay. My approach was to install Visual Studio, then ArcGIS, followed by the ArcObjects and the SDKs.

My dilemma right now is that after upgrading my machine to Windows 10 Enterprise and Visual Studio 2015 Enterprise, I can't get the same ArcObjects to work with this new version of Visual Studio. Anyone with an idea on how to go around this will be much appreciated.

Thank you.

0 Kudos
YuanLiu
Occasional Contributor

ArcObjects 10.3 does not officially support Visual Studio 2015. It only supports VS 2012 and 2013. For more info, please refer to ArcObjects SDK 10.3.x system requirements—Help | ArcGIS for Desktop
ArcObjects 10.2 supports Visual Studio 2010 and 2012, System Requirements

SeanSweeney
New Contributor III

Are there any plans for VS 2015 support?

0 Kudos
isburns
New Contributor III

I was able to install the SDK for ArcGIS 10.3 with Visual Studio 2015. There were 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 45263 - Unable to generate add-ins when migrating from older to newer versions of Visual Studio used... .

  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 Download Microsoft Visual Studio 2013 SDK from Official Microsoft Download Center 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

GusMartinka
Occasional Contributor

I was able to get this trick to work for 10.5.1 on a machine with only VS 2017. I had to change "14.0" to "15.0" and use the registry paths under C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE and C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise. After the sdk installed I had to copy "C:\Program Files (x86)\MSBuild\Esri" to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Esri" and I removed the VS version conditions. Then to get my Addin to actually build I downloaded the 2013 shell from 

https://my.visualstudio.com/Downloads?q=shell and had to change the installer name vs_isoshell.exe to get it to install. 

0 Kudos
JanaMartin
New Contributor III

After reading the posting from @Shea Burns, I found another way.

If you had already installed both VS 2013 and the 10.3.1 SDK; then you can do the following.

Copy the following into the same paths for vs 2015 (Microsoft Visual Studio 14.0):

Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\ArcGIS

Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplatesCache\CSharp\ArcGIS

Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates\CSharp\ArcGIS

Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplatesCache\CSharp\ArcGIS

Microsoft Visual Studio 12.0\Common7\IDE\Extensions\ESRI

Follow step 4. from @Shea Burns.

Then run these command from cmd.exe   (https://msdn.microsoft.com/en-us/library/y3kkate1.aspx )

devenv /installvstemplates.

devenv /setup.

Then you just have to make sure that all your assemblies are compiled to 4.5.0. You will get the following error if you forget to change your version. 

               " The "ValidateAddInXMLTask" task failed unexpectedly." 

0 Kudos