的MSBuild签署的ClickOnce或组装结果在错误MSB3

的MSBuild签署的ClickOnce或组装结果在错误MSB3

本文介绍了使用的MSBuild签署的ClickOnce或组装结果在错误MSB3321的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了我的简单的项目在Visual &工作室NBSP; 2008年使用的ClickOnce 安装程序。我指定的ClickOnce的清单应当由北美经销商我们的 PFX 文件签署。当我在Visual Studio中设置此它要求的密码PFX文件,我很乐意提供。一切正常,当我构建和在Visual Studio中发布。它也可以在我的机器上从的MSBuild 优美的建筑。

I've set up my simple project in Visual Studio 2008 to use a ClickOnce installer. I've specified that the ClickOnce manifests should be signed by our comapny's PFX file. When I set this up in Visual Studio it asked for the password for the PFX file, which I gladly supplied. Everything works fine when I build and publish from within Visual Studio. It also works fine building from MSBuild on my machine.

然而,当我尝试使用的MSBuild我们的构建机器上构建它,我得到以下错误:

However, when I try to build it using MSBuild on our build machine, I get the following error:

ERROR MSB3321 in
    C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7)
    : Importing key file "ourCertificate.pfx" was canceled (sic).

在一些搜索,我发现了一点点信息,说这是因为我还没有提供的密码。但我不能找到一种方法来提供密码的生成计算机上。我也看到了建议安装Visual Studio和Visual Studio内部的提供密码一次,然后就在那之后,从工作的MSBuild。但我真的想避免在构建机上安装Visual Studio。

After some searching I've found a little bit of information that says this is because I haven't supplied the password. But I can't find a way to supply the password on the build machine. I've also seen suggestions to install Visual Studio, and supply the password once inside Visual Studio, and then it will work from MSBuild after that. But I'd really like to avoid installing Visual Studio on the build machine.

我试着双击PFX文件导入,然后把在输入密码时问,但是这并没有帮助。

I've tried double clicking the PFX file to import it and putting in the password when asked, but this didn't help.

这同样的事情发生,如果我检查注册程序集在Visual Studio和提供相同的PFX文件。

This same thing happens if I check 'Sign the assembly' in Visual Studio and supply the same PFX file.

我怎样才能解决这个问题呢?有没有存储密码的生成计算机上的手工方式?

How can I fix this problem? Is there a manual way of storing the password on the build machine?

推荐答案

您可以导入您的证书到您的受信任的发布者库的构建机上?(IE浏览器>工具>选项>内容>证书)

Can you import your certificate into your Trusted Publisher store on the build machine?(Internet Explorer > Tools > Options > Content > Certificates)

我不使用的MSBuild创建的部署;我用法师。但是,我用我们的.pfx文件导入我们的证书到我信任的发布者库。为了做到这一点我必须输入密码。经过这样做了,当我节省体现在法师我不再需要提供密码。我可以简单地从我的店里选择证书。

I don't use MSBuild to create deployments; I use Mage. However, I use our .pfx file to import our cert into my Trusted Publisher store. In order to do that I have to input the password. After that's done, when I save a manifest in Mage I no longer have to provide a password. I can simply select the cert from my store.

这篇关于使用的MSBuild签署的ClickOnce或组装结果在错误MSB3321的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 23:29