Reputation: 191
As the title says, how do I disable the DEP feature for a specific C# project rather than the whole of the OS? I use Visual Studio 2017
I need to use an old ActiveX Dll within the project, which requires this feature disable otherwise it will throw errors at runtime.
Note I have looked everywhere and followed every google search. My properties/options don't seem to match whats said on the internet (maybe because I'm using VS 2017??)
Thanks
Upvotes: 1
Views: 1510
Reputation: 191
Okay so I fixed it thanks to everyone's help:
Make sure to install VC++ 2017 v141-Toolset (x86,x64)
Add the following to the Post-Build event:
call "$(DevEnvDir)..\tools\vsdevcmd.bat"
"$(DevEnvDir)....\VC\Tools\MSVC\14.13.26128\bin\Hostx86\x86\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"
There must be a newline between ...vsdevcmd.bat" and "$(DevEnvDir... Also the toolset version may change (14.13.26128) so adjust where necessary.
Upvotes: 2