Select to view content in your preferred language

build Add-ins From msbuild command-line

12834
22
11-29-2011 11:09 AM
LukeBadgerow
New Contributor
I am in the process of putting together a CI Server application (Jenkins) that is currently building my SOA application.  I would like to add a desktop add-in that I am also working on to this server, however in order for that to happen I need to be able to build with msbuild.exe.  When I try and compile my add-in project with msbuild I receive the following error (more specifically, the following comes from Jenkins, but it's the same error locally):

Started by user anonymous
Updating http://subversion-repo/EngineeringServices/DesktopGISUtilities/DOTNET/WaterEditorExtension
At revision 1241
no change for http://subversion-repo/EngineeringServices/DesktopGISUtilities/DOTNET/WaterEditorExtension since the previous build
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe
Executing command: cmd.exe /C C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe c:\workspace\dotnet\watereditor10\watereditorextension.csproj && exit %%ERRORLEVEL%%
[workspace] $ cmd.exe /C C:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe c:\workspace\dotnet\watereditor10\watereditorextension.csproj && exit %%ERRORLEVEL%%
Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3623]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 11/29/2011 11:20:08 AM.
Project "c:\workspace\dotnet\watereditor10\watereditorextension.csproj" on node 0 (default targets).
Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5".
C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.targets(36,5): error MSB4062: The "ValidateAddInXMLTask" task could not be loaded from the assembly ESRI.ArcGIS.AddIns.SDK, Version=10.0.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 <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.
Done Building Project "c:\workspace\dotnet\watereditor10\watereditorextension.csproj" (default targets) -- FAILED.

Build FAILED.

"c:\workspace\dotnet\watereditor10\watereditorextension.csproj" (default target) (1) ->
(PrePackageArcGISAddIn target) ->
  C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.targets(36,5): error MSB4062: The "ValidateAddInXMLTask" task could not be loaded from the assembly ESRI.ArcGIS.AddIns.SDK, Version=10.0.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 <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.68
Build step 'Build a Visual Studio project or solution using MSBuild.' marked build as failure
Finished: FAILURE
0 Kudos
22 Replies
Cristian_Galindo
Occasional Contributor III

Well, I tried everything described here: install the SDK of VS2010, run my VS as admin, Create the build for x86.....but nothing ever happen...I got the same error I'm trying to compile an Add-in in VS 2013

0 Kudos
Cristian_Galindo
Occasional Contributor III

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?

0 Kudos
Cristian_Galindo
Occasional Contributor III

First, I check that Microsoft.VisualStudio.Shell.9.0 was in the GAC, It was not there... tVisual Studio Command Prompt --> Run as Administrator --> gacutil /i Microsoft.VisualStudio.Shell.9.0.dll, but it failed because I was not giving the full path of the dll, so I search for it in the Visual Studio 2008 SDK, and Voila!!! it appear in the GAC

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.

0 Kudos