How to use Visual Studio 2015 to compile ArcGIS 10.3.1 Addin project?

3616
6
09-03-2016 07:49 AM
PeterLi1
New Contributor III

How to use Visual Studio 2015 to compile ArcGIS 10.3.1 Addin project?

Looks I need to modify the file: ESRI.ArcGIS.AddIns.11.targets, but still doesn't work. My Visual Studio 2015 project uses .NET Framework 4.5.2.

After modifying the file as seen below, even I get more errors from the compiling when using ArcGIS 10.3.1 and Visual Studio 2015. Because I am using Visual Studio 2015 and ArcGIS 10.3.1, so I see I need to change the following conditions in ESRI.ArcGIS.AddIns.11.targets, in order to avoid compiling error for ESRI Addin:

from:

Condition="'$(VisualStudioVersion)' == '12.0'"

to

Condition="'$(VisualStudioVersion)' == '14.0'"

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

Before modifying the file, the compiling errors are:

C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.11.targets(41,5): error MSB4036: The "ValidateAddInXMLTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.

After modifying the file, the compiling errors are:

\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.11.targets(41,5): error MSB4018: The "ValidateAddInXMLTask" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.11.targets(41,5): error MSB4018: System.FormatException: Input string was not in a correct format.
1>C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.11.targets(41,5): error MSB4018:    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)

0 Kudos
6 Replies
ModyBuchbinder
Esri Regular Contributor

Hi

This version of VS and framework is not supported in 10.3.1 ArcObjects SDK 10.3.x system requirements—Help | ArcGIS for Desktop 

The best way is to install one of the supported VS, then you have all the templates ready to use in it.

You create your solution in VS 1012 and then you can just keep working on it in VS 2015 (and change the framework too).

It works for me...

PeterLi1
New Contributor III

Thanks, Do you mean that I have to use ArcGIS 10.4 with VS 2015, and can not keep working on ArcGIS 10.3.1, that we actually need it?

0 Kudos
ModyBuchbinder
Esri Regular Contributor

That is not what I mean.

Install VS2012. Then create a new solution for ArcGIS 10.3.1 using one of the templates. make sure you can compile it.

Then open and work with this solution using VS2015 - it should work.

Use VS2012 ONLY to create the initial solution in the correct way.

PeterLi1
New Contributor III

Thanks for your reply.  That's what I did. I always use VS 2012 and ArcGIS 10.3.1 and has no problem, but the above errors occurred when using VS 2015. The error couldn't be resolved. So I thought VS2015 is not good for ArcGI 10.3.1

0 Kudos
chandrareddy
New Contributor

1- Unload the project (in Solution Explorer) by right-clicking the Project and selecting "Unload Project"
2- Right click the unloaded project and select "Edit Project". An XML file opens (*.csproj).
3- In the XML, search for the attribute value that contains the following string: ESRI.ArcGIS.AddIns.targets. You will find three occurrences of this string.
4- Change this string to the following: ESRI.ArcGIS.AddIns.11.targets. Essentially, add the integer "11" after Addins.
5- Save the XML (*.csproj) file, and close it.
6- Right-click the project, and select "Reload Project".
7- Recompile your project. The error should have been resolved.
8- Repeat the above steps for all Add-In projects in your solution.

0 Kudos
MichaelRobb
Occasional Contributor III

^^ this does not work.

Original error:

As per your steps... changed the following to:

End of your steps...

and rather than the 1 error...

now have, in this case, 74.  all related to inheriting AddIns.

0 Kudos