如何使用 32 位程序集构建在 x64 Server 2008 上运行的 C# MVC 应用程序

发布于 2024-08-19 07:56:06 字数 321 浏览 1 评论 0原文

我们有一个 MVC 应用程序,它依赖于许多第三方产品(例如 Crystal、Topaz)。 Topaz 签名设备仅提供 32 位 .dll。因此,我假设我需要在 IIS 7 上的 32 位应用程序池中构建和部署应用程序。

如果这个假设是正确的,那么我是否需要将 VS2008 编译器设置为“x86”来构建 MVC 应用程序(现在我正在使用“任何 CPU”?

此外,所有引用的程序集都需要是 32 位的吗?如果是这样,我如何将 32 位 MVC 文件加载到 x64 Server 2008 上?

最后,如何使 inetpub/ 目录对 x86 友好,还是由于其他原因而神奇地发生了?

We have a MVC application that depends on a number of 3rd party products (e.g., Crystal, Topaz). The Topaz signature device only has 32-bit .dlls available. So I'm assume that I need to build and deploy the app on IIS 7 in an a 32-bit App Pool.

If that assumption is correct, then do I need to build the MVC app with the VS2008 compiler setting to "x86" (right now I'm using "Any CPU"?

Also, do all the referenced assemblies need to be 32-bit as well? If so, how do I get 32-bit MVC files onto a x64 Server 2008?

Finally, how do I make the inetpub/ directories x86 friendly, or does that magically happen as a consequence of something else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

败给现实 2024-08-26 07:56:06

如果这个假设是正确的,那么
我需要使用以下命令构建 MVC 应用程序
VS2008编译器设置为“x86”
(现在我正在使用“任何CPU”?

您可以将其设置为任何 CPU,它将在 32 位或 64 位上运行,具体取决于您的应用程序池设置,并且只要您的其他依赖 dll 也使用“任何中央处理器”

此外,执行所有引用的程序集
也需要是32位的吗?如果是这样,如何
我可以将 32 位 MVC 文件放到 x64 上吗
服务器 2008?

如果您使用非托管代码(或引用程序集),则需要获取该程序集的特定 32 位和 64 位版本。如果您有 32 位程序集,并且在应用程序池中启用 32 位应用程序,则它们将在WoW64模式

另一个参考:http://blogs.msdn.com /gauravseth/archive/2006/03/07/545104.aspx

如果您有 x64 版本,它们将作为 64 位本地运行

黄玉签名装置只有
32 位 .dll 可用。所以我假设
我需要构建和部署
IIS 7 上 32 位应用程序池中的应用程序。

你是如何验证的?您使用 Corflags.exe 吗?您可以在此处了解更多信息。无论您的 PE 标头(PE32 或 PE32+)如何,如果您的 32BIT 设置为 0,您都可以在 64 位应用程序池上运行它。即使它设置为 1 并且未签名,您也可以将其设置为 0 (但可能不值得冒这个风险)并在 64 位应用程序池上运行它

If that assumption is correct, then do
I need to build the MVC app with the
VS2008 compiler setting to "x86"
(right now I'm using "Any CPU"?

you can set it to any CPU and it will run on 32 bit or 64 bit, depending on your app pool settings and as long as your other dependent dlls are also compiled with "any CPU"

Also, do all the referenced assemblies
need to be 32-bit as well? If so, how
do I get 32-bit MVC files onto a x64
Server 2008?

If you are using unmanaged code (or reference assemblies) you need to get the specific 32 bit and 64 bit version of that assembly.If you have 32 bit assemblies and if you enable 32 bit applications in your app pool, they would be run in WoW64 mode

another reference: http://blogs.msdn.com/gauravseth/archive/2006/03/07/545104.aspx

If you have x64 version,they would be run natively as 64 bit

The Topaz signature device only has
32-bit .dlls available. So I'm assume
that I need to build and deploy the
app on IIS 7 in an a 32-bit App Pool.

How did you verify it? Did you use Corflags.exe ? You can know more about it here. Regardless of your PE header (PE32 or PE32+) if your 32BIT is set to 0, you can run it on a 64 bit app pool.Even if it is set to 1 and if it is not signed, you can set it to 0 (but might not be worth taking the risk) and run it on 64 bit app pool

黑凤梨 2024-08-26 07:56:06

您的 MVC 应用程序是否以 32 位运行有什么关系吗?或者您有令人信服的理由尝试使用 64 位吗?

如果您可以使用 32 位,请将所有程序集编译为 x86。当您在 x64 server 2008 上配置 IIS 时,请确保更新应用程序池上的“高级设置” - 将“启用 32 位应用程序”设置为 true。

帕特里克

Does it matter if your MVC app runs as 32-Bit? Or do you have a compelling reason to try to go to 64-Bit?

If you can live with 32-bit, complile all of your assemblies as x86. When you configure IIS on your x64 server 2008, make sure to update the "Advanced Settings" on your app pool -set "Enable 32-Bit Applactions" to true.

Patrick

陪你到最终 2024-08-26 07:56:06

如果这个假设是正确的,那么
我需要使用以下命令构建 MVC 应用程序
VS2008编译器设置为“x86”
(现在我正在使用“任何CPU”?

是的,完全正确。

此外,执行所有引用的程序集
也需要是32位的吗?如果是这样,如何
我可以将 32 位 MVC 文件放到 x64 上吗
服务器 2008?

不需要,如果这些程序集是作为任何 CPU 构建的,那么 .Net 框架会将其解析为 32 位,只要您的入口程序集是 32 位。

最后,我如何制作inetpub/
目录 x86 友好,或者那样
神奇地发生作为结果
还有别的吗?

它就神奇地发生了。

If that assumption is correct, then do
I need to build the MVC app with the
VS2008 compiler setting to "x86"
(right now I'm using "Any CPU"?

Yes, entirely correct.

Also, do all the referenced assemblies
need to be 32-bit as well? If so, how
do I get 32-bit MVC files onto a x64
Server 2008?

No need, if those assemblies are built as ANY CPU, then the .Net framework will resolve it to 32 bit, as long as your entry assembly is 32 bit.

Finally, how do I make the inetpub/
directories x86 friendly, or does that
magically happen as a consequence of
something else?

It just happens magically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文