PackageAction seems to have no effect when building Add-In

1547
5
Jump to solution
03-18-2019 09:16 PM
BenReschke
New Contributor II

I have created a C# project for a ArcGIS Pro 2.3 Add-In. I have ArcGIS Pro 2.3 installed as well as the ArcGIS Pro 2.3 SDK.

In the .csproj file I have changed the value of PackageAction from 'BuildDefault' to 'BuildZipPostProcess' and then again to 'BuildNoPostProcess' and reloaded the entire VS Solution after each change. But neither seem to stop the .esriAddinX file from being created and then placed in %UserProfile%\ArcGIS\AddIns\ArcGISPro\{GUID}\

If I leave PackageAction as 'BuildNoPostProcess' and then rename the Registry Key HKLM\SOFTWARE\ESRI to something else then the .esriAddinX file is no longer copied to the %UserProfile% directory but .esriAddinX file is still created in the Visual Studio solutions $(OutDir) directory. According to the comments provided by the template, this PackageAction should not have done anything??

Here is the Build Output:

5> MyDataSet.Plugin -> ...\Release\MyDataSet.Plugin.dll
5> ZipIntermediatePath Name: obj\Release\temp_archive\...
5> IntermediateOutputPath Name: obj\Release\...
5> CleanFile Name: MyDataSet.Plugin.csproj.FileListAbsolute.txt...
5> ProjectDir Name: ...\ArcGISPro\ArcGISPro.Plugin\...
5> AssemblyName Name: MyDataSet.Plugin...
5> TargetFileName Name: MyDataSet.Plugin.dll...
5> RootNamespace: MyDataSet.Plugin...
5> TargetFolder Name: ...\Release\...
5> PackageType Name: Addin...
5> Install dir:
5> ...
5> ...
5> ConvertToRelativePath Task, TargetDir: ...\Release\
5> Deploying Addin...
5> ArcGISFolder Name: ...
5> Unable to execute RegisterAddIn.exe. ArcGIS Pro is not installed.
========== Build: 5 succeeded, 0 failed, 71 up-to-date, 0 skipped ==========

It still wants to run everything all the way up to registering the AddIn with a installation of ArcGIS Pro.

This out is the same regardless of what PackageAction I have set in the .csproj file. And if the Registry Key for ESRI is named correctly, it will package the .esriAddinX file and copy it to the %UserProfile% AddIn discovery directory.

Here is the relevant section of my .csproj file for the above output:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!--
PackageAction can be:
BuildDefault: ArcGIS Pro is required. An esriAddinX package is created and copied to ArcGIS Pro add-in folder.
BuildZipPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is created in your output folder.
BuildNoPostProcess: ArcGIS Pro install is NOT required to build the add-in. An esriAddinX package is NOT created.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PackageAction>BuildNoPostProcess</PackageAction>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PackageAction>BuildNoPostProcess</PackageAction>
</PropertyGroup>
<UsingTask AssemblyFile="$(AGProInstallDir)bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.PackageAddIn" />
<UsingTask AssemblyFile="$(AGProInstallDir)bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.CleanAddIn" />
<UsingTask AssemblyFile="$(AGProInstallDir)bin\proapp-sdk-MSBuild.dll" TaskName="proapp_sdk_MSBuild.ConvertToRelativePath" />
<Import Project="$(AGProInstallDir)bin\Esri.ProApp.SDK.Desktop.targets" Condition="Exists('$(AGProInstallDir)bin\Esri.ProApp.SDK.Desktop.targets')" />

So what am I doing wrong?

Thanks

Ben

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi Ben

The recommended approach now at 2.3 to run "server" builds of the add-in without Pro installed is to use the ArcGIS Pro Extensions NuGet.

View solution in original post

5 Replies
UmaHarano
Esri Regular Contributor

Hi Ben

The recommended approach now at 2.3 to run "server" builds of the add-in without Pro installed is to use the ArcGIS Pro Extensions NuGet.

BenReschke
New Contributor II

Thanks, this is what we have done now and it is working great.

However, when digitally signing the esriAddinX file we still need to have ArcGIS Pro install to get access to the ArcGISSignAddin.exe utility... Is this not going to be made part of the NuGet package?

0 Kudos
UmaHarano
Esri Regular Contributor

Hi

With the 2.4 release, SignAddIn.zip is now available to download from the Assets section: https://github.com/Esri/arcgis-pro-sdk/releases/tag/2.4.0.19948

Extract the contents to your build server to sign the add-in without Pro installed.

Thanks

Uma

0 Kudos
JonasVan_Nieuwenberg
New Contributor

Dear Uma,

We tried using the above SignAddIn.zip on our build server, but the ArcGISSignAddIn.exe process still failed (exit code -1073741515).

After some trial and error, we noticed that the following DLLs (not included in the .zip package) are also required:

  • concrt140.dll
  • msvcp140.dll
  • vcruntime140.dll

Any idea what could be the reason for this?

Kind regards,

Jonas

0 Kudos
CharlesMacleod
Esri Regular Contributor

sounds like the Microsoft Visual C++ redistributable package is missing from your server machine

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

0 Kudos