有没有一种方法可以强制“任何CPU”启动?编译的应用程序可以在64位OS上以32位模式运行? [英] Is there a way to force an "Any CPU" compiled app to run in 32bit mode on 64bit OS?

查看:113
本文介绍了有没有一种方法可以强制“任何CPU”启动?编译的应用程序可以在64位OS上以32位模式运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个任何CPU编译的.NET应用程序,它将在64位OS上以64位模式运行。

If I have a "Any CPU" compiled .NET app, it will run in 64bit mode on a 64bit OS.

但是如果我出于某种原因,想要强制此应用以32位模式运行。 (好像是使用 x86编译的一样)。重新编译不是一个选项,因此可以在运行时进行配置吗?也许有了.manifest文件?

But if I, for whatever reason, wants to force this app to run in 32bit mode. (As if it were compiled using "x86"). Recompiling is not an option, so is this possible to config at run time ? With the .manifest file perhaps?

推荐答案

我相信您可以使用 CorFlags.exe

类似于:

CorFlags yourassembly.exe / 32BIT +

Something like:
CorFlags yourassembly.exe /32BIT+

请注意,如果程序集是强名称,则还必须使用/ force选项,以破坏强名称,因此,然后必须辞职。

Note that if the assembly is strong named you will also have to use the /force option which breaks the strong naming, so you'll then have to resign the assembly.

这篇关于有没有一种方法可以强制“任何CPU”启动?编译的应用程序可以在64位OS上以32位模式运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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