3

We have an ArcMap Desktop add-in, created a few years ago using ArcObjects in .NET framework 3.5. I'm looking into updating it to framework 4.5 (or 4.5.1) to be compatible with a newer project that it needs to use now.

I've bumped it up to 4.5 in a test copy and I'm not seeing any errors or erratic behavior (in the few minutes I tested it) but I'm wondering if anyone has been through this process and has had any issues down the road or has any suggestions on what I should be on the lookout for.

Also, when I bump the test copy up to 4.5.1 I do get the following error. I'll research this one myself as well, but in case this is related the experience anyone else has had so I'm adding it in.

Error:

Error 2 The "ValidateAddInXMLTask" task failed unexpectedly. System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) at ESRI.ArcGIS.AddIns.SDK.Utilities.ToAddInCLRLanguage(String strTargetFramework) at ESRI.ArcGIS.AddIns.MSBuild.ValidateAddInXMLTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() NDOTGeolocator

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 15, 2016 at 20:38
1
  • 1
    I think to debug properly in visual studio you will have to edit the ArcMap.exe.config file. Comment out <supportedRuntime version="v2.0.50727"/> and uncomment or add <!--<supportedRuntime version="v4.0.30319"/>--> Commented Aug 16, 2016 at 17:12

2 Answers 2

1

follow the below KB article. If you are using ArcGIS 10.4.1 with visual studio 2015 the error is bound to be thrown as the Microsoft Visual Studio Shell 12.0 library is missing in visual studio 2015.

http://support.esri.com/technical-article/000012659

answered Aug 30, 2016 at 19:52
1

I think there is a bug in the ESRI tools that can't cope with .NET version numbers that contain a second "." (hence ParseDouble failing).

My Add-in builds fine with .NET 4.6 or 4.7 but not 4.6.1 (which is what I wanted to target).

My workaround to the problem was to edit the ESRI.ArcGIS.AddIns.targets file (in the MSBuild\ESRI folder) and change the line that calls ValidateAddInXMLTask to hard-code a version with only one "." in it in the TargetFrameworkVersion parameter, e.g.:

<ValidateAddInXMLTask ContentFiles="@(AddInContent)" BuildProjectPath="$(ProjectPath)" AssemblyName="$(TargetFileName)" TargetFrameworkVersion="4.6" /> 

This seemed to work OK even though my project was targetting 4.6.1

answered Jun 21, 2017 at 8:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.