views:

326

answers:

2

I have a .net assembly that needs to be 32-Bit and needs to be /LARGEADDRESSAWARE.

I know how to do this with EditBin, but I wonder if there is a built-in way in Visual Studio 2010? Or alternatively, did someone write an MSBuild Task for this?

Edit: This is for a C# app, so no linker options sadly :(

+3  A: 

You can do it as a Post-build task. In "Build Events" tab, put following command

editbin /largeaddressaware $(TargetPath)

into the "Post-build event command line:"

This is the case for VS2008. I think it should work in the same way for VS2010.

RouMao
+3  A: 

Building on @RouMao's answer, you may get an error message saying that editbin cannot be found. Ensure that the environment in the post-build event command line is setup properly by specifying as follows:

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

Another thing to understand is that if under the Debug tab in your project properties that the Enable the Visual Studio hosting process checkbox is checked (default), your application will not run with LARGEADDRESSAWARE (because the vshost.exe is not properly flagged). Uncheck that box to debug your application using LARGEADDRESSAWARE.

Michael