3

I need to compile my C# application with high entropy VA turned off due to a vendor library incompatibility. The only way I've found to do it so far is a post-build step with editbin, but that's quite clunky. Is there a better way?

Matt Chambers
  • 2,229
  • 1
  • 25
  • 43
  • Here's the start of a solution. Use a response file that has this option set. Modify the csproj file to define a `` property which will tell the Csc task to use that file. – Mike Zboray Dec 19 '14 at 17:26

1 Answers1

14

The IDE is missing support for this option in the Build property sheet. But that's easy to work around, you can simply add the property to the .csproj file by hand. Open it in a text editor, Notepad is fine. Locate the <FileAlignment> property and add after it:

   <HighEntropyVA>False</HighEntropyVA>

And rebuild the project. You can verify by running dumpbin.exe /headers on the generated executable file:

       ...
       8540 DLL characteristics
              Dynamic base
              NX compatible
              No structured exception handler
              Terminal Server Aware

And note the missing "High Entropy Virtual Addresses" characteristic.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536