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

13

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.

c#
visual-studio
asked on Stack Overflow Apr 27, 2015 by David • edited Mar 9, 2020 by Peter Mortensen

4 Answers

20

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.
answered on Stack Overflow Apr 27, 2015 by Saagar Elias Jacky • edited Mar 9, 2020 by Peter Mortensen
11

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

answered on Stack Overflow Jan 16, 2017 by Long Trinh Văn • edited Mar 9, 2020 by Peter Mortensen
2

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

answered on Stack Overflow Jan 30, 2019 by hgbarria • edited Mar 9, 2020 by Peter Mortensen
0

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.

answered on Stack Overflow Jan 1, 2020 by ElasticCode • edited Mar 9, 2020 by Peter Mortensen

User contributions licensed under CC BY-SA 3.0