title: How to sign a console application in visual studio
body: <p>I am trying to run some code to add to my project, but it wont work as intended. The code is on this page:</p>
  
  <p><a href="https://docs.microsoft.com/en-gb/previous-versions/windows/desktop/ics/c-registering-with-windows-firewall-ownership" rel="nofollow noreferrer">https://docs.microsoft.com/en-gb/previous-versions/windows/desktop/ics/c-registering-with-windows-firewall-ownership</a></p>
  
  <p>It requires that I run it with the '/integritycheck' linker flag. Doing so prevents the resulting exe from running.</p>
  
  <p>So far i have tried signing the exe with a self signed code signing certificate, which I added to the store of trusted certificates. Even then after signing it and verifying the signature, the exe still does not run.
  Checking the 'Digital Signatures' tab on the properties page of the exe shows that everything is all good.</p>
  
  <p><a href="https://i.stack.imgur.com/x6Ie3.png" rel="nofollow noreferrer">This</a> is what it looks like.</p>
  
  <p>When i try to run the exe, a dialog box shows up saying something along the lines of "Windows could not verify the digital signature of this file". As stated above, to my knowledge, I have signed it properly, therefore the dialog box should not show up, and let the program run.</p>