Assuming I have booted a 32-bit Windows Server with the /3GB switch, how can I make a .NET application use the additional address space?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The flag is part of the image header, so you need to modify that using editbin.
editbin /LARGEADDRESSAWARE <your exe>
Use dumpbin /headers
and look for the presence of Application can handle large (>2GB) addresses
to see if the flag is set or not.
回答2:
From what I can tell you have to use the editbin utility shown in the existing answer. There does not appear to be any way to set the flag using Visual Studio .NET, it looks like they encourage people to compile for 64 bit if possible instead of using the flag
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=93771
回答3:
For doing it automaticaly from Visual studio, please refer to this question : flag from visual studio.
回答4:
Add those lines to Post build:
call "$(DevEnvDir)..\tools\vsdevcmd.bat"
editbin /largeaddressaware "$(TargetPath)"
From: vsvars32.bat in Visual Studio 2017