How to publish a project without temporary key - Visual Studio 2019

Apostolos Doudakmanis 41 Reputation points

I have built an application and want to make it executable by publishing

When I publish the program, it creates a temporary key file, which I don't want it to create because it creates a problem for me and shows me the message: "Default certificate could not be created. "

Publish aborting and then displays the message in the Output tab "Build has been cancelled."

In the Security tab I have not selected the Enable ClickOne security settings option, as well as in the Singing tab I have not selected Sign the ClickOne manifests

What should I do to publish my app without this temporary key file?

Microsoft Technologies based on the .NET software framework.
3,330 questions
{count} votes

Accepted answer
  1. Jack J Jun 24,276 Reputation points Microsoft Vendor

    @Apostolos Doudakmanis, thanks for the feedback, as the method add the temporary key file to the signatures is working for you and I will post it as an answer.

    In case the link doesn't work, I'll post the specific solution steps below:

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

    Will I have a problem with the signature expiration?

    Yes, you will have. However, you could refer to the link Timestamps to use Timestamps ensure that its certificate will continue to be accepted even after expiration.

    Will it ask for my signature again in another program?

    If you still get the error Default certificate could not be created., it is necessary for you to sign it again.

    Best Regards,


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful