David
David

Reputation: 161

C# 2013 Default certificate could not be created. Publish aborting

When I try to run a .exe that I built in Visual Studio 2013 with C# it will run just fine on the machine I compiled it in. When I try to run the program on different machines I get exception errors.

So I tried to publish the program and I get this error:

Default certificate could not be created. Publish aborting

If I run the executable from a machine that has Visual Studio on it it works fine.

When I try to create a certificate I get the error

The Profile for the user is a temporary profile. (exception from HRESULT:0x80090024)

I would like this executable to run at start-up on all Windows 7 student computers in our school.

Upvotes: 15

Views: 26885

Answers (4)

Saagar Elias Jacky
Saagar Elias Jacky

Reputation: 2688

You need to tell the publisher where to get the certificate from:

  1. Go to ProjectProperties
  2. Go to the tab named "Signing"
  3. Check the checkbox labeled "Sign the ClickOnce manifests". This enables the section where you can point to a certificate.
  4. Click on the button labeled "Select From File...". In the directory listing, choose a key file (.pfx) and Open....
  5. From the step 3, click the button labeled "More Details...". This will display the certificate you've just selected.
  6. Click "Install Certificate" and follow the prompts.
  7. Save and Publish your solution.

Upvotes: 24

Long Trinh Văn
Long Trinh Văn

Reputation: 151

Run Visual Studio with administrative rights (Run as administrator).

Upvotes: 14

hgbarria
hgbarria

Reputation: 31

Run as administrator. It worked for me (Visual Studio 2017).

Upvotes: 2

ElasticCode
ElasticCode

Reputation: 7875

The below solution works for me using Visual Studio 2017 Community Edition in Windows 10.

Make sure that your account has write access to folder 'C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys'.

Also make sure your account has write access to the folder where you are creating the key.

Upvotes: 1

Related Questions