部署标识与订阅不匹配。我的TemporaryKey.pfx在哪里?

时间:2013-07-08 14:07:44

标签: .net clickonce code-signing

我有一个使用ClickOnce部署的可视化基础项目。

当我使用ClickOnce发布它时,我发现没有任何问题。

当我使用msbuild.exe发布它时,我遇到了问题。当用户启动应用程序时,他收到错误消息:The deployment identity does not match the subscription.

我也在同一个日志文件上发出警告:

WARNINGS
* The manifest for this application does not have a signature. Signature validation will be ignored.

在搜索Google时,我被认为可以通过在Visual Studio和msbuild.exe之间使用相同的pfx文件来解决问题(它不会自动找到pfx文件)。

在项目文件(blahblahblah.vbproj)中有这个节点:

<PropertyGroup>
    ...
    <ManifestKeyFile>blahblahblah_TemporaryKey.pfx</ManifestKeyFile>
    ...
</PropertyGroup>

但是,在我的项目文件夹中,没有这样的文件。现在,Visual Studio必须从某个地方获取该文件,因为我经常使用Visual Studio发布该项目,并且没有问题。

我还比较了生成的2个blahblahblah.application文件,唯一的区别是版本(应该随每个出版物而改变)和DigestValue。

<dependency>
    <dependentAssembly dependencyType="install" codebase="Application Files\blahblahblah_I_1_0_0_84\blahblahblah.exe.manifest" size="101425">
        <assemblyIdentity name="blahblahblah.exe" version="1.0.0.84" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="x86" type="win32" />
            <hash>
                <dsig:Transforms>
                    <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
                </dsig:Transforms>
                <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <dsig:DigestValue>lgzZRBBqxOOKi0IJcMCIBEWRU2A=</dsig:DigestValue>
            </hash>
        </dependentAssembly>
    </dependency>
</asmv1:assembly>

另外,正如您所注意到的,我有publicKeyToken =“0000000000000000”,这两个版本都是相同的。

要解决此问题,用户必须卸载并重新安装该应用程序。不幸的是,这对我的客户来说是不可接受的,所以我必须找到一个解决方案。我可以尝试让它们接受一次,但是我需要能够从msbuild或Visual Studio发布而没有这样的冲突。

所以,我的问题是,我必须做些什么才能使The deployment identity does not match the subscription错误消失?

1 个答案:

答案 0 :(得分:0)

到目前为止,缺少.pfx ...你有没有看过CertMgr.msc,特别是证书 - 当前用户\个人\证书?很可能Visual Studio使用SHA1 DigestValue来匹配代码签名证书的SHA1指纹。您应该可以右键单击&gt;所有任务&gt;导出...并将私钥导出到.pfx容器中,然后可以在构建计算机上导入该容器(导入到msbuild使用的用户帐户中)。