ArcGIS Pro二次开发Addin文件加入数字证书

ArcGIS Pro二次开发Addin文件加入数字证书

 

通过ArcGIS Pro二次开发生成的Addin文件,根据最新的技术要求,也需要数字签名证书,否则会被认为存在风险的应用程序。如下图

 

如果在ArcGIS Pro的 “加载项管理器” 的 “选项” 设置中 不选择 “不受限制的加载任何加载项(最不安全)”选项,那么我们编写的Addin程序都无法加载到ArcGIS Pro中。

要解决这个问题,需要在AddIn中加入数字签名证书。

具体做法如下:

  1. 获取数字签名证书.pfx文件

 

2、打开Pro二次开发的工程文件

 

在项目文件上点击右键菜单,选择 “卸载项目”

 

 

 

在卸载的项目上,右键 菜单,选择 “编辑xxx.csproj”

在工程文件xxx.csproj文件的最后加上数字签名证书的相应内容,如下图

  <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="ArcGISSignAddIn.exe文件路径 $(TargetDir)$(TargetName).esriAddInX

          /c:pfx所在的路径

          /p:密码

          /s" />

  </Target>

 

保存更改,重新加载工程

 

编辑工程文件,到编译目录重新安装Addin文件,如下图

 

 

 

 

发布了59 篇原创文章 · 获赞 10 · 访问量 39万+

猜你喜欢

转载自blog.csdn.net/jixg1800/article/details/104544804
今日推荐