office加載項部署清單簽名的證書或其位置不受信任


異常信息:

System.Security.SecurityException: 此應用程序中的自定義功能將不起作用,原因是用於為 BIMT寫作指導 的部署清單簽名的證書或其位置不受信任。請向管理員尋求進一步幫助。
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyTrustPromptKeyInternal(ClickOnceTrustPromptKeyValue promptKeyValue, DeploymentSignatureInformation signatureInformation, String productName, TrustStatus status)
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyTrustUsingPromptKey(Uri manifest, DeploymentSignatureInformation signatureInformation, String productName, TrustStatus status)
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyTrustUsingPromptKey(Uri manifest, DeploymentSignatureInformation signatureInformation, String productName)
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.ProcessSHA1Manifest(ActivationContext context, DeploymentSignatureInformation signatureInformation, PermissionSet permissionsRequested, Uri manifest, ManifestSignatureInformationCollection signatures, AddInInstallationStatus installState)
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySecurity(ActivationContext context, Uri manifest, AddInInstallationStatus installState)
在 Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
失敗的程序集的區域是:
MyComputer

異常截圖:

結覺方案:

 1  private void button1_Click(object sender, EventArgs e)
 2         {
 3             try//32位
 4             {
 5                 Microsoft.Win32.RegistryKey key;
 6                 key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\MICROSOFT\.NETFramework\Security\TrustManager\PromptingLevel");
 7 
 8                 key.SetValue("MyComputer", "Enabled");
 9                 key.SetValue("LocalIntranet", "Enabled");
10                 key.SetValue("Internet", "Enabled");
11                 key.SetValue("TrustedSites", "Enabled");
12                 key.SetValue("UntrustedSites", "Enabled");
13                 key.Close();
14                 MessageBox.Show("Security Reg Done!");
15             }
16             catch (Exception ex)
17             {
18                 MessageBox.Show(ex.Message);
19             }
20         }
21 
22         private void button2_Click(object sender, EventArgs e)
23         {
24             try//64位
25             {
26                 Microsoft.Win32.RegistryKey key;
27                 key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Wow6432Node\MICROSOFT\.NETFramework\Security\TrustManager\PromptingLevel");
28 
29                 key.SetValue("MyComputer", "Enabled");
30                 key.SetValue("LocalIntranet", "Enabled");
31                 key.SetValue("Internet", "Enabled");
32                 key.SetValue("TrustedSites", "Enabled");
33                 key.SetValue("UntrustedSites", "Enabled");
34                 key.Close();
35                 MessageBox.Show("Security Reg Done!");
36             }
37             catch (Exception ex)
38             {
39                 MessageBox.Show(ex.Message);
40             }
41         }

軟件下載地址:http://pan.baidu.com/s/1jH3Rc1o

msdn說明:https://msdn.microsoft.com/zh-cn/library/ms996418.aspx


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM