Postbuild signing event issue since 1.4 SDK update

722
2
02-27-2017 04:06 AM
by Anonymous User
Not applicable

Hello. I'm using the "AfterBuild" event in the project file of my C# add-in to sign the add-in file after it is successfully built, as shown in the ProGuide page here:

ProGuide Digitally signed add ins · Esri/arcgis-pro-sdk Wiki · GitHub 

Here is the snippet from my project file, which has worked fine up until the recent 1.4 SDK:

Now whenever I build in release mode (note the condition), I get this error:

Can anyone advise? If I remove the "DependsOnTargets" part, it tries to sign the add-in before it has finished building the add-in file, so fails.

Regards,

Luke

0 Kudos
2 Replies
UmaHarano
Esri Regular Contributor

Hi Luke,

The DependsOnTargets value should be PackageArcGISContents.  This snippet below works for me.

Thanks

Uma

 <Target Name="AfterBuild" DependsOnTargets="PackageArcGISContents">
    <!--Replace the path in the sample command below to your pfx file on disk and use the password that has been assigned to the pfx file.
        Confirm that the path to ArcGIS Pro bin folder matches your installation location.-->
    <Exec Command="&quot;C:\Program Files\ArcGIS\Pro\bin\ArcGISSignAddIn.exe&quot; $(TargetDir)$(TargetName).esriAddInX /c:D:\esri.pfx /p:*****/s" />
    <!-- Note: to register the Add-in you need to run RegisterAddin.exe. Modify the path to your RegisterAddin.exe
          location as needed-->
    <Exec Command="&quot;C:\Program Files\ArcGIS\Pro\bin\RegisterAddin.exe&quot; $(TargetDir)$(TargetName).esriAddInX /s" />
  </Target>
0 Kudos
by Anonymous User
Not applicable

Thank you Uma. I'm confused as to why it's been working for me up until now if I got the value wrong... strange!

Regards,

Luke

0 Kudos