My c# application has a "force integrity disabled" problem

CHEN LI 1 Reputation point
2022-05-23T10:45:16.897+00:00

Hi Guys:
My c# application has a "force integrity disabled" problem.
We can add "/INTEGRITYCHECK" command to configuration properties ->linker->command line to solve this problem in c++ project, how can I do in a c# project?
Someone told me IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY need to be set,how can I set this flag in C# program.
Help me please,Thx.

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,817 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grigorii Vasilchenko 0 Reputation points
    2024-05-30T19:33:29.8833333+00:00

    You can use link.exe to modify PE Header and set IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY characteristic after the build:

    1. Start Developer Command Prompt
    2. Run command link /edit /INTEGRITYCHECK C:/Test/YourApp.exe
    0 comments No comments