Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LargeAddressAware Visual Studio 2015 C#

So today I decided I would update to Visual Studio 2015 (previously running the RC version with no difficulties) but now my project does not like the /LARGEADDRESSAWARE command line event.

I have a post-build event of:

call "$(DevEnvDir)..\tools\vsvars32.bat"
editbin /largeaddressaware "$(TargetPath)"

However I get the following error:

The command "call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE..\tools\vsvars32.bat" editbin /largeaddressaware "C:\...\bin\Debug\Application.exe"" exited with code 9009

Any thoughts?

like image 864
Rolodium Avatar asked Jul 22 '15 14:07

Rolodium


2 Answers

I call a cmd script as a PostBuildEvent:

IF  EXIST  "%VS140COMNTOOLS%"  CALL  "%VS140COMNTOOLS%vsvars32.bat"
IF  EXIST  "%VS120COMNTOOLS%"  CALL  "%VS120COMNTOOLS%vsvars32.bat"
IF  EXIST  "%VS110COMNTOOLS%"  CALL  "%VS110COMNTOOLS%vsvars32.bat"
IF  EXIST  "%VS100COMNTOOLS%"  CALL  "%VS100COMNTOOLS%vsvars32.bat"

editbin.exe /LARGEADDRESSAWARE MyApp.exe

It checks for the environment variable according to the installed VS (first 2015, next 2013, next 2012 and finally 2010) and now all paths are fine.

If it still can't find the .exe, make sure the C++ Tools option in the installer is selected. By default VS2015 only installs C# and VB.net, but not C++ with its tools. Here you have to activate it under custom in the setup:

enter image description here

like image 198
magicandre1981 Avatar answered Oct 15 '22 18:10

magicandre1981


If you set your platform to "Any CPU" this flag is set for you by default now in Visual Studio 2015.

See Compiling C# with Any CPU sets Application can handle large (>2GB) addresses.

like image 8
Chris Weber Avatar answered Oct 15 '22 16:10

Chris Weber