在带有引用的C#项目上设置LARGEADDRESSAWARE? [英] Setting LARGEADDRESSAWARE on a C# project with references?

查看:73
本文介绍了在带有引用的C#项目上设置LARGEADDRESSAWARE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读此处有关如何设置LARGEADDRESSAWARE标志,这是对我的Windows服务完成的.但是,此Windows服务正在托管基于另一个项目的WCF服务,并且该服务正在使用其他项目中的库等.

I have read here on how to set the LARGEADDRESSAWARE flag and this is done to my Windows Service. This Windows Service is however hosting a WCF service based on another project and this service is using library's and so on from other projects.

我需要整个应用程序使用LARGEADDRESSAWARE,是否需要在Window Service项目(ServiceBase)上进行设置?还是我需要在所有项目上进行设置?

I need the entire application to use the LARGEADDRESSAWARE, is it enouth to set it on the Window Service project(ServiceBase)? Or do I need to set it on all projects?

这时我不能切换到64位,所以必须这样做.

At this point I can´t switch to 64bits so this will have to do.

推荐答案

IDE不提供该选项,您可以通过在构建后事件中运行editbin.exe来将其打开.此答案显示了您需要使用的命令.

It is not an option that's exposed by the IDE, you'll to turn it on by running editbin.exe in a post-build event. This answer shows the commands you need to use.

但是请注意,您很可能会为此浪费精力.仅当操作系统可以提供一个支持大地址"的执行环境时,它才会起作用.使用/3GB启动选项在很多年前曾经是可能的,但不久前就不再有用了.在服务器上也非常有害,它们确实需要内核地址空间.当您的服务器启动Windows的64位版本时,它仍然很有用,如果将它们与/LARGEADDRESSAWARE链接,则任何32位代码都可以获得4 GB的地址空间.但是,如果您使用的是这样的操作系统,那么将项目的目标平台更改为AnyCPU无疑是一种更有效率的方法,可以利用您在64位进程中获得的更大的地址空间.也许这不适用于您的特定情况,但否则是最佳的一般建议.

Do note however that it is fairly likely that you are wasting energy on this. It will only have an effect when the operating system can provide an execution environment that supports "large addresses". That used to be possible many years ago with the /3GB boot option but has stopped being useful a while ago. Also very detrimental on servers, they really need the kernel address space. It is still useful when your server boots a 64-bit version of Windows, any 32-bit code can get a 4 GB address space if they are linked with /LARGEADDRESSAWARE. But if you have such an operating system then changing the project's Target platform to AnyCPU is certainly the much more productive way to take advantage of the much larger address space you get in a 64-bit process. Maybe that doesn't apply in your specific case but is otherwise the best general advice.

这篇关于在带有引用的C#项目上设置LARGEADDRESSAWARE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆