Amon
Amon

Reputation: 295

error MSB3325: Cannot import the following key file: csc.pfx. The key file may be password protected

I know very well this error as I faced it and solved it thanks to this SO post.

The sn -i keyName.pfx VS_KEY_XXXXXXXXXXXXX ran from a Visual studio developer command prompt solved it on my computer.

I now use a jenkins job to build my solution with each new commit. What happens is that the git repository is cloned, then compiled using msBuild.exe. But as the job doesn't run on my computer and I do not have a manual access to the developper command prompt to run this command.

How could I achieve the same thing using only relative path to the .pfx file and editing files in the git repository ? I can execute non interactive dos commands, but I don't know where the sn command is located.

As suggested by this question I tried tosomehow edit the csproj file or use a prebuild event but i couln't achieved anything that even let my solution compile.

Upvotes: 0

Views: 621

Answers (1)

Amon
Amon

Reputation: 295

I used this tool . It basically is a tool that is portable and performs the same thing as sn -i key.pfx VS_KEY_XXXXXXXXXXXXX. It even compute the vs_key name automatically if wanted.

Upvotes: 0

Related Questions