Hi all
I'm trying to build one/any of the .NET REST SOE samples in the SDK, but keep hitting the same problem.
For example - I open the NetFindNearFeaturesRestSOE sample, and try to build the project but the following error is produced by Visual Studio:
'Index (zero based) must be greater than or equal to zero and less than the size of the argument list'
Looking a little deeper this seems to relate to the MSBUILD file ESRI.ArcGIS.AddIns.Server.targets, and specifically the GenerateServerAddInXml task - it looks like this task/underlying .NET class is not accessible to the build process, for some reason.
Running MSBUILD /v:diagnostic against the project yields the following error:
C:\Program Files (x86)\MSBuild\ESRI\ESRI.ArcGIS.AddIns.Server.targets(37,5): error MSB4062: The "GenerateServerAddInXml" task could not be loaded from the assembly ESRI.ArcGIS.AddIns.SDK, Version=10.1.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, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
So it seems to be this part of ESRI.ArcGIS.AddIns.Server.targets that is of interest:
<!-- Custom MSBuild tasks -->
<UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="PackageAddIn" />
<UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ValidateServerAddInXMLTask" />
<UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ConvertToRelativePath" />
<UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="ResolveAddInReference" />
<UsingTask AssemblyName="ESRI.ArcGIS.AddIns.SDK, Version=10.1.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" TaskName="GenerateServerAddInXml" />
<!-- Set up default zip properties -->
<PropertyGroup>
<ZipFileExtension Condition="'$(ZipFileExtension)' == ''">ecfg</ZipFileExtension>
<ZipIntermediatePath Condition="'$(ZipIntermediatePath)' == ''">$(IntermediateOutputPath)$(ZipFileExtension)\</ZipIntermediatePath>
</PropertyGroup>
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
GenerateServerAddInXml;
PackageArcGISAddInContents;
RunArcGISPostPackageEvent
</BuildDependsOn>
<CleanDependsOn>
$(CleanDependsOn);
CleanArcGISAddin
</CleanDependsOn>
</PropertyGroup>
<Target Name="GenerateServerAddInXml">
<GenerateServerAddInXml ContentFiles="@(AddInContent)" BuildProjectPath="$(ProjectPath)" AssemblyName="$(TargetFileName)" TargetFolder="$(OutDir)" ZipIntermediatePath="$(ZipIntermediatePath)" />
</Target>
Has anyone seen anything similar, and/or has any suggestions? Is there a problem with the Esri assembly, or might this be a red herring?
All help gratefully received, and at least if no one has a solution someone else searching for the same problem might no feel so lonely 😛
Many thanks
Rob