有没有办法强制“任何 CPU"?编译的应用程序在 64 位操作系统上以 32 位模式运行? [英] Is there a way to force an "Any CPU" compiled app to run in 32bit mode on 64bit OS?

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

问题描述

如果我有一个任何 CPU"编译的 .NET 应用程序,它将在 64 位操作系统上以 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 位操作系统上以 32 位模式运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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