安装时单击消息框:强名称签名对程序集microsoft.mshtml.dll无效

时间:2013-12-02 16:10:54

标签: clickonce

我刚开始在clickonce应用程序中出现以下错误。我之前在我的机器上安装了visual studio 2013“应用程序验证未成功。无法继续。

当我点击详细信息时,我得到了

Activation of C:\Temp\ClickOnce\myApp\myApp.application resulted in exception.
Following failure messages were detected:
Strong name signature not valid for this assembly Microsoft.mshtml.dll.

我也有两个警告,但我不相信它们是问题的原因

  • 此应用程序的清单没有签名。签名验证将被忽略。
  • 此应用程序的清单没有签名。签名验证将被忽略。

错误详细信息列为

ERROR DETAILS
    Following errors were detected during this operation.
    * [02/12/2013 15:54:31] System.Deployment.Application.InvalidDeploymentException (SignatureValidation)
        - Strong name signature not valid for this assembly Microsoft.mshtml.dll.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.ComponentVerifier.VerifyStrongNameAssembly(String filePath, AssemblyManifest assemblyManifest)
            at System.Deployment.Application.ComponentVerifier.VerifyComponents()
            at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

我没有签署clickonce清单。选中“启用clickonce安全设置”。 “这是一个完全信任的应用程序”被选中

1 个答案:

答案 0 :(得分:6)

我对此进行了排序。我要做的就是进入我的项目右键单击,添加对程序集的引用 - 扩展名和Microsoft.mshtml下列出的两个dll文件。我在他们每个人身上盘旋,看到一个人的路径是

c:/program files/Microsoft.NET/Primary Interop Assemblies/Microsoft.html.dll

c:/program files/Microsoft Visual Studio 12.0/Visual Studio Tools For Office/PIA/Common/Microsoft.mshtml.dll.

我的项目引用是Visual Studio中的第二个 - 我在项目属性下更改了对主互操作程序集中的引用我转到了发布选项卡并单击了我设置发布状态以包含的应用程序文件。然后我去项目属性/引用并双击microsoft.mshtml来打开它的属性,我将'embed interop types'设置为false并将'copy local'设置为true(因为copy local gred out为false)。

之后我将其上传到我的clickonce服务器,并能够下载并安装它。