Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:37:01+00:00 2026-06-07T05:37:01+00:00

I am trying to build a ClickOnce Windows Forms project (.NET 3.5 / Visual

  • 0

I am trying to build a ClickOnce Windows Forms project (.NET 3.5 / Visual Studio 2010) on a Windows Server computer. (In an effort to automate the build process with Hudson CI.)

For signing the ClickOnce manifest I created a temporary key in Visual Studio, temp.pfx. I can successfully build and deploy the project from Visual Studio on my workstation. But when running MSBuild on the server I get the following error messages:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1970,9): error MSB3326: Cannot import the following key file: . The key file may be password protected. To correct this, try to import the certificate again or import the certificate manually into the current user’s personal certificate store. [C:.hudson\jobs[…].csproj]

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1970,9): error MSB3321: Importing key file “temp.pfx” was canceled. [C:.hudson\jobs[…].csproj]

I tried all of the following questions and answers without luck:

  • Stack Overflow question Cannot import the keyfile ‘blah.pfx’ – error ‘The keyfile may be password protected’

    => In my case, the error message does not indicate a name of a certificate store but says “the current user’s personal certificate store” instead.

    => Even when trying the accepted answer with “Personal” as the container name (sn -i temp.pfx personal), it fails to parse the key:

    Failed to parse the PKCS#12 blob in ALiS_TemporaryKey.pfx — An internal error o
    ccurred.

  • Stack Overflow question Using MSBuild to sign ClickOnce or assembly results in error MSB3321

    => I tried the accepted answer, but the key file cannot be imported because “Either the user profile is not accessible or the private key that you are importing might require a cryptographic service provider that is not installed on your system”

    => The same happens if I try to import the file by double-clicking it in Windows Explorer (RobinDotNet’s suggestion)

  • Stack Overflow question Signing assemblies with PFX files in MSBuild, Team Build, and TFS

    => The OP of that question was unsuccessful with the above two answers, too, but unfortunately not even the answers that he got would help me:

    Log in as the user that runs MSBuild on the build machine, manually invoke MSBuild, and then type in the password when prompted.

    => I logged in and ran msbuild myproject.sln but it would not even prompt me for the password.

    What finally fixed it for me was making the account under which TFS Build service runs an administrator on the local machine.

    => The account that runs Hudson (more precisely: Tomcat) already is a local administrator. I tried to run MSBuild from a “Run As Administrator” command line even and would get the same error messages still.


Update: I tried to open the solution in Visual Studio on the same server and build it. I get the same error. When I try to re-import the PFX file in the project properties’ Signing tab, it tells me “invalid password”. If I try to import the very same file in the very same solution in Visual Studio on my workstation and provide the very same password, it is accepted.

Update 2: If I take an old temporary key which I had generated with Visual Studio 2008, it can be successfully imported in the certificate store of our server; any temporary keys I newly create with Visual Studio 2010 cannot be imported.

Update 3: I was able to create a new “temporary key” in Visual Studio on the server and use it both on the server as well as on my workstation for signing the ClickOnce manifest. I only cannot make up a reasonable explanation for it – both computers are 64-bit, and I am using Visual Studio 2010 on both. Both have the v3.5 and v4 (4.0.30319) .NET framework installed. My workstation is a Windows 7 Professional, and the server is a Windows Server 2008 R2 Standard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:37:03+00:00Added an answer on June 7, 2026 at 5:37 am

    Copy the PFX file over to the machine you are doing the builds on. Double-click on it, and install it in the certificate manager on the machine. Be sure you are logged into the account used to do the builds.

    Other suggestions/questions: Do you have the right version of .NET installed on the machine? Do you have privileges to write to the certificate store on that machine?

    If you open the Visual Studio project, go to the project properties and try to create a new certificate, does it work? It should create a PFX file and add it to the project. And can you see it in the certificate store (menu Start/certmgr.msc)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build Xuggler under Windows. Xuggler is core native code functions wrapped into
Trying to build my project with ANT in idea 10 and I get a
I'm trying to build a generic grid view in an ASP.NET MVC application. Let
Trying to build a mavenized project with NetBeans fails: Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.5:generate
I have a WPF, ClickOnce application that I am trying to build using the
Am trying to build boost on x64 windows. So far all is going well,
I am trying to build a ASP.NET MVC website wherein I need to use
trying to build an ad hoc distribution with Xcode 4. Consider that my project.xcodeproj
I'm trying to prepare to build a database driven .net application and I have
Trying to build Android open source project on Ubuntu 10.04 (on VMware Player). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.