visual-c++vspropsaslr

MSVC linker won't apply RandomizedBaseAddress via vsprops file


I am trying to add ASLR to a project using a vsprops file. I have verified the file is being used by the project as there are other settings in the file that are being applied, and intentionally corrupting the file produces an error when opening the project under MSVC. When I set ASLR to yes I can see RandomizedBaseAddress="2" under <Tool Name=VCLinkerTool.

but... It has no effect. I can also put RandomizedBaseAddress="xxxxx" and it doesn't care. It's as if that setting for the linker isn't being picked up. I also tried GenerateDebugInformation="True" which is another setting I've seen other vsprops files use, and that's ignored too. It's as if the linker is ignoring the vsprops file or these settings in it.

What gives? Has anyone seen this before?


Solution

  • The project file explicitly specified "default" for those parameters, thus overriding the vsprops file. Explicitly setting those items to "inherit from parent or project defaults" fixed the problem. Thanks for all the responses.