How to digitally sign the Application.exe during publish ?

Sanket Vinod Solanki 30 Reputation points
2023-07-28T06:32:12.32+00:00

Hi,

We want to publish the MAUI application after digitally signing the Application main .DLL and .EXE Files using DigiCert Hardware token certificate.

Steps we followed is:

  1. Re-Build the Project in Release Mode
  2. Digitally Sign the respective file of DLL and Exe present in Bin and Obj folder through DigiCert Hardware Token
  3. Publish the project in Release Mode
  4. During publish it has option to add Certificate, so we add the DigiCert respective certificate (so that it signs the msix file after publishing).

After Step 4 the Package (msix file) is successfully created with Digital Signature and ready to install.

Post installation, the Application files are present in C:\ProgramsFiles\WindowsApp folder, over here the Digital signature is not found in EXE File i.e Digital signature from EXE file is removed but digital signature is present in DLL file.

We tried with POST BUILD events also, before publishing the Digital signature is present in EXE and DLL, but after publishing the Digital signature gets removed from EXE.

Please provide your suggestions on this.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,156 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,575 questions
{count} votes