“Unable to find manifest signing certificate in the certificate store” - even when add new key

Visual Studio-2010Visual StudioCode SigningStrongname

Visual Studio-2010 Problem Overview


I cannot build projects with a strong name key signing - the message in the title always comes up.

Yes the project was initially copied over from another machine. However even if I add a new key via the Signing tab in Project Properties, this error is still shown.

I have tried running Visual Studio as an Administrator and have tried manually adding the keys to Windows Certificate Store.

Help!

Edit: I don't get this error with a new project, but I'd quite like to get this existing project working. It won't work even if I create a new certificate!

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

I've finally found the solution.

  1. Edit the .csproj file for the project in question.

  2. Delete the following lines of code:

    <PropertyGroup>
       <ManifestCertificateThumbprint>...........</ManifestCertificateThumbprint>
    </PropertyGroup>
    <PropertyGroup>
       <ManifestKeyFile>xxxxxxxx.pfx</ManifestKeyFile>
    </PropertyGroup>
    <PropertyGroup>
       <GenerateManifests>true</GenerateManifests>
    </PropertyGroup>
    <PropertyGroup>
       <SignManifests>false</SignManifests>
    </PropertyGroup>
    

Solution 2 - Visual Studio-2010

Go to your project's "Properties" within visual studio. Then go to signing tab.

Then make sure Sign the Click Once manifests is turned off.


Updated Instructions:

Within your Solution Explorer:

  1. right click on your project
  2. click on properties
  3. usually on the left-hand side, select the "Signing" tab
  4. check off the Sign the ClickOnce manifests
  5. Make sure you save!

enter image description here

Solution 3 - Visual Studio-2010

It's simple!!

I resolved this problem by following this steps:

  1. Open project properties img
  2. Click on Signing Tab
  3. And uncheck "Sign the assembly"

That's it!!

Solution 4 - Visual Studio-2010

  1. Open the .csproj file in Notepad.

  2. Delete the following information related to signing certificate in the certificate store

     <PropertyGroup>
       <ManifestCertificateThumbprint>xxxxx xxxxxx</ManifestCertificateThumbprint>
       <ManifestKeyFile>xxxxxxxx.pfx</ManifestKeyFile>
     <GenerateManifests>true</GenerateManifests>
     <SignManifests>false</SignManifests>
     </PropertyGroup>
    

Solution 5 - Visual Studio-2010

Try this:

Right click on your project → Go to properties → Click signing which is left side of the screen → Uncheck the Sign the click once manifests → Save & Build

Solution 6 - Visual Studio-2010

Go to your projects "Properties" within visual studio. Then go to signing tab.

Then make sure Sign the Click Once manifests is turned off.

OR

1.Open the .csproj file in Notepad.

2.Delete the following information related to signing certificate in the certificate store xxxxx xxxxxx xxxxxxxx.pfx true false `

Worked for me.

Solution 7 - Visual Studio-2010

Assuming this is a personal certificate created by windows on the system you copied your project from, you can use the certificate manager on the system where the project is now and import the certificate. Start the certificate manager (certmgr) and select the personal certificates then right click below the list of existing certificates and select import from the tasks. Use the browse to find the .pfx in the project (the .pfx from the previous system that you copied over with the project). It should be in the sub-directory with the same name as the project directory. I am familiar with C# and VS, so if that is not your environment maybe the .pfx will be elsewhere or maybe this suggestion does not apply. After the import you should get a status message. If you succeeded, the compile certificate error should be gone.certmgr screen

Solution 8 - Visual Studio-2010

To sign an assembly with a strong name using attributes

Open AssemblyInfo.cs (in $(SolutionDir)\Properties)

the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, specifying the name of the file or container that contains the key pair to use when signing the assembly with a strong name.

add the following code:

[assembly:AssemblyKeyFileAttribute("keyfile.snk")]

Solution 9 - Visual Studio-2010

It is not enough to manually add keys to the Windows certificate store. The certificate only contains the signed public key. You must also import the private key that is associated with the public key in the certificate. A .pfx file contains both public and private keys in a single file. That is what you need to import.

Solution 10 - Visual Studio-2010

You said you copied files from another computer. After you copied them, did you 'Unblock' them? Specifically the .snk file should be checked to make sure it is not marked as unsafe.

Solution 11 - Visual Studio-2010

If you need just build the project or solution locally then removing the signing might be a dead simple solution as others suggest.

But if you have this error on your automation build server like TeamCity where you build your actual release pieces for deployment or distribution you might want to consider how you can get this cert properly installed to the cert store on the build machine, so that you get a signed packages at the end of the build.

Generally it is not recommenced to check-in/commit any PFX certificates into source control, so how you get this files on your build server during the build process is a bit another question, but sometimes people do have this file stored along with the solution code, so you can find it in the project folder.

All you need to do is just install this certificate under proper account on your build server.

  1. Download PsExec from Windows Sysinternals.

  2. Open a command prompt, and enter the following. It will spawn a new command prompt, running as Local System (assuming that your TeamCity is running under the default Local System account):

    > psexec.exe -i -s cmd.exe

  3. In this new command prompt, change to the directory containing the certificate and enter the filename to install (change the name of the file to yours):

    > mykey.pfx

  4. The Import Certificate wizard will start up. Click through and select all the suggested defaults.

  5. Run the build.

All credits goes to Stuart Noble (and then further to Laurent Kempé I believe ☺).

Solution 12 - Visual Studio-2010

Just ran into this (again), due to PFX cert not being included in the code, for security.

For local testing, like Debug builds, the lead programmer of this solution had me go into Properties, Signing, click on "Create Test Certificate". In our setting he said just click ok, but one can put in a strong password here if warranted/needed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMarcusView Question on Stackoverflow
Solution 1 - Visual Studio-2010MarcusView Answer on Stackoverflow
Solution 2 - Visual Studio-2010ADLView Answer on Stackoverflow
Solution 3 - Visual Studio-2010Amit KadamView Answer on Stackoverflow
Solution 4 - Visual Studio-2010Rajamohan RajendranView Answer on Stackoverflow
Solution 5 - Visual Studio-2010xoxoView Answer on Stackoverflow
Solution 6 - Visual Studio-2010AshView Answer on Stackoverflow
Solution 7 - Visual Studio-2010dpminusaView Answer on Stackoverflow
Solution 8 - Visual Studio-2010QuangNHbView Answer on Stackoverflow
Solution 9 - Visual Studio-2010Owen WengerdView Answer on Stackoverflow
Solution 10 - Visual Studio-2010Owen WengerdView Answer on Stackoverflow
Solution 11 - Visual Studio-2010SevenateView Answer on Stackoverflow
Solution 12 - Visual Studio-2010DigDugView Answer on Stackoverflow