Unable to run Excel VSTO Add-ins

允我心安 提交于 2019-12-10 12:09:44

问题


Trying to run an Excel 2013 VSTO Add-ins project, and I keep on getting an error that says that:

"System.Security.SecurityException: The solution cannot be installed because it is signed by a publisher whom you have not yet chosen to trust. If you trust the publisher, add the certificate to the Trusted Publisher list."

The project has a key file with signature algorithm sha256RSA and certificate issued to/by the Windows User.

Any idea how to get around this ?


回答1:


Try the solutions from the postings here.

As for myself, I've developed an Excel VSTO AddIn with a self-signed untrusted certificate that is delivered by a custom Setup.exe which is then installed on machines that belong to some end-users. I have no control over these machines because the end-users just download my Setup.exe from a public website. After setup the path of the .vsto is a local file path so I don't need a web server as a host.

In my case the following code (placed in my Setup.exe) is enough to successfully trust the Excel VSTO:

UserInclusionList.Add(new AddInSecurityEntry(new Uri(vstoFilePath),
    "<RSAKeyValue><Modulus>...</Modulus><Exponent>...</Exponent></RSAKeyValue>"));

The corresponding <RSAKeyValue> can be found in your .vsto file.



来源:https://stackoverflow.com/questions/40025720/unable-to-run-excel-vsto-add-ins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!