Visual studio installer project code signing issue

jesdev7 6 Reputation points
2022-08-03T11:30:14.767+00:00

I've been trying to get my .NET core program signed (the executable and dlls) with Visual Studio.
In the build directory everything works fine: the properties of the files show my digital signature.

However when I use the Visual Studio Installer Projects extension to make a .msi installer it doesn't seem to sign anything.
The extracted files of my program after running the installer on a clean machine don't have a digital signature.
I've tried using the "Sign the assembly" option in the project settings as well as using signtool.exe in the post build event.
Both options seem to give the same end result.

I'm using Visual Studio 2019 Professional. Maybe there's an option I'm missing but I can't seem to figure it out.
This is the first time I'm using code signing in a project.

Developer technologies | .NET | Other
{count} vote

3 answers

Sort by: Most helpful
  1. Okundu Omeni 5 Reputation points
    2024-09-26T17:02:39.58+00:00

    I am having exactly the same issue with VS2022. I initially thought the issue was when I was doing the signing in the wrong folder as the binaries in the publish folder were not signed. So i added a pre-build event to the installer to sign the binaries in the published folder before generating the msi. When I checked the published folder the binaries are now signed but the generated msioutput binaries are still unsigned.

    It would appear the signing is being reversed by the packaging process.

    1 person found this answer helpful.
    0 comments No comments

  2. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2022-08-18T09:37:45.3+00:00

    Hi @jesdev7 ,

    Welcome to Microsoft Q&A forum.

    Please try to select Release, and rebuild the Setup project under Release mode, then check if it works.

    232332-image.png

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly 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.

  3. Michael Pasternak 0 Reputation points
    2024-03-28T22:15:08.08+00:00

    It does not work. Microsoft team, please fix this bug

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.