LargeAddressAware Visual Studio 2015 C#
Asked Answered
I

4

21

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?

Indifferentism answered 22/7, 2015 at 14:7 Comment(8)
Separate each command with ; and try again.Damages
Unfortunately that was the first thing I tried, it doesn't make much sense that this has had to change when it work in the 2015 RC version perfectly fine... And the two location directories are correctly, I manually checked both and both files exist where they are supposed to be :(Indifferentism
to me it looks like its running the whole post build event as one commandDamages
Works fine on my machine. Look in the Output window for a more specific error message.Hemialgia
Tested this on Visual Studio 2013 and builds fine with the above post-build events but still doesn't work in 2015. I have changed the events to have separate calls to 2 different batch scripts and they are called in the correct sequence. The issue only occurs when I add the second line.Indifferentism
Output windows gives the following error "'editbin' is not recognized as an internal or external command, operable program or batch file."Indifferentism
It is located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\editbin.exe Use Explorer to see if it is there. That directory has 45 files, if it is substantially empty then the VS2015 install did not go well. Usually caused by not properly uninstalling a CTP or RC version.Hemialgia
That is exactly what has happened... editbin.exe is in the VC directory and not the bin directory... ThanksIndifferentism
I
3

The issue was caused when uninstalling the Visual Studio 2015 RC version. It does not remove all the directories and therefore the install of the full release version is not successful. The simple solution is to uninstall the RC version and restart. Then manually delete the C:\Program Files (x86)\Microsoft Visual Studio 14.0 directory. Then you can install the the new version without any issues.

Credit Hans Passant for identifying this issue.

Indifferentism answered 23/7, 2015 at 8:44 Comment(0)
C
50

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

Cardigan answered 22/7, 2015 at 16:6 Comment(5)
Thanks a ton, that was exactly the issue I had ! Had not installed the C++ Tools ...Scrutator
This is what worked for me, however I also noticed an existing postbuild command I had from a migrated VS2013 project had special quote characters which had apparently worked before. Changing these to neutral quotes worked.Hylozoism
If I'd already have c++ and f# installed, how could I uninstall them? Is that even possible?Corn
@Corn in this dialog, uncheck the entries ;)Cardigan
This is a correct solution. You actually only need to install the "Common Tools...", saves a few GB of install.Rann
T
8

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.

Trestlework answered 20/1, 2016 at 17:4 Comment(0)
I
3

The issue was caused when uninstalling the Visual Studio 2015 RC version. It does not remove all the directories and therefore the install of the full release version is not successful. The simple solution is to uninstall the RC version and restart. Then manually delete the C:\Program Files (x86)\Microsoft Visual Studio 14.0 directory. Then you can install the the new version without any issues.

Credit Hans Passant for identifying this issue.

Indifferentism answered 23/7, 2015 at 8:44 Comment(0)
B
2

My problem with this, that I was calling vcvarsall.bat from the wrong location first. I'd upgraded to Visual Studio 2017, and vcvarsall.bat had moved. (So had EditBin.exe. There are 4 locations for it now, though I changed to using whatever was in the path.) Fixing that, fixed the problem. Here's my post-build file for your purview.

:: Install C++ tools to have these installed

:: build for 32 bit     
:: VS 2012 call "$(DevEnvDir)..\..\vc\vcvarsall.bat" x86 

:: build for 64
:: VS 2012 call "$(DevEnvDir)..\..\vc\vcvarsall.bat" amd64
:: VS 2017
call "$(DevEnvDir)..\..\VC\Auxiliary\Build\vcvarsall.bat" amd64

:: "$(DevEnvDir)..\..\vc\bin\EditBin.exe" "$(TargetPath)"  /LARGEADDRESSAWARE
EditBin "$(TargetPath)"  /LARGEADDRESSAWARE
Bullough answered 24/5, 2017 at 19:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.