异常信息:
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
异常截图:
结觉方案:
private void button1_Click(object sender, EventArgs e)
{
try//32位
{
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\MICROSOFT\.NETFramework\Security\TrustManager\PromptingLevel"); key.SetValue("MyComputer", "Enabled");
key.SetValue("LocalIntranet", "Enabled");
key.SetValue("Internet", "Enabled");
key.SetValue("TrustedSites", "Enabled");
key.SetValue("UntrustedSites", "Enabled");
key.Close();
MessageBox.Show("Security Reg Done!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} private void button2_Click(object sender, EventArgs e)
{
try//64位
{
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Wow6432Node\MICROSOFT\.NETFramework\Security\TrustManager\PromptingLevel"); key.SetValue("MyComputer", "Enabled");
key.SetValue("LocalIntranet", "Enabled");
key.SetValue("Internet", "Enabled");
key.SetValue("TrustedSites", "Enabled");
key.SetValue("UntrustedSites", "Enabled");
key.Close();
MessageBox.Show("Security Reg Done!");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
软件下载地址:http://pan.baidu.com/s/1jH3Rc1o
msdn说明:https://msdn.microsoft.com/zh-cn/library/ms996418.aspx