从 64 位应用程序引用 .net 1.1 程序集
我必须将项目从 32 位升级到 64 位。我的项目目前在 .net 2.0 上(很快就会是 4.0,但对于这个问题来说并不重要)。我的项目引用了一些旧的 .net 1.1 程序集,我只有二进制形式。众所周知,64 位支持仅在 .net 2.0 中添加,并且我预计我的应用程序将因这些旧程序集而无法运行。
但是,我的应用程序在引用 .net 1.1 dll 时以 64 位模式在 x64 服务器上运行(任务管理器中没有显示星号)。
我的问题是:
- 它为什么运行?我之前读到你不能使用 .net 1.1 64 位应用程序中的程序集。
- 如果我保留 1.1 程序集会有什么缺点吗?或者我应该花精力去获取这些 1.1 程序集的更新版本吗?
编辑:我忘了提及,要求是以 64 位本机运行应用程序 (asp.net)。该应用程序以 64 位运行,因为我在应用程序池上禁用了 32 位兼容性。
EDIT2:我只是尝试编译并运行为 x64 编译的应用程序。有用。所以它以纯 64 位模式运行,对此没有任何疑问。
I have to upgrade a project from 32 bit to 64 bit. My project is currently on .net 2.0 (will be soon 4.0, but doesn't really matter for this issue). My project is referencing some old .net 1.1 assemblies, that I only have in binary form. As you all know, 64 bit support was added in .net 2.0 only, and I expected my application won't run because of those old assemblies.
However, my application runs on a x64 server in 64 bit mode (no star is shown in Task Manager) while referencing the .net 1.1 dll.
My questions are:
- Why does it run? I previously read that you cannot use .net 1.1
assemblies in 64 bit apps. - Are there any shortcomings if I keep the 1.1 assemblies? Or should I invest effort in getting newer versions of those 1.1 assemblies?
EDIT: I forgot to mention that a requirement is to run the application (asp.net) natively in 64 bit. The application runs in 64 bit because I disabled 32 bit compatibility on my application pool.
EDIT2: I just tried to compile and run the application compiled for x64. It works. So it runs in pure 64 bit mode, no questions about it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.NET 1.1 程序集包含与 .NET 2 或 .NET 4 程序集相同类型的 IL。仅元数据的格式发生了变化。抖动不介意将其转换为 64 位机器代码,并且 CLR 可以读取旧的元数据格式。仅当 .NET 1.1 程序集包含本机代码时才会出现问题。 Corflags.exe 实用程序,ILONLY 位。没有令人信服的理由来重建该程序集。
A .NET 1.1 assembly contains the same kind of IL as a .NET 2 or .NET 4 assembly. Only the format of the metadata has changed. The jitter doesn't mind translating it to 64-bit machine code and the CLR can read the old metadata format. Only if the .NET 1.1 assembly contains native code will you have a problem. Corflags.exe utility, ILONLY bit. There's no compelling reason to rebuild that assembly.
您的应用程序是否在 wow32(32 位模拟模式)下运行?大多数应用程序并不真正在 x64 模式下运行,它们强制应用程序在 wow32(x86 模式)下运行,以保持其在较旧的 x86 系统上的向后兼容性。否则,应用程序将仅在 x64 系统上运行,而不能在 x86 上运行。
强制应用程序在 x86 模式下运行(甚至在 x64 系统上)只允许运行任何机器,无论它是 32 位还是 64 位 Windows 操作系统。
Is your application running under wow32 (32-bit emulation mode)? Most applications do not really run in x64 mode, they force the application to run in wow32 (x86 mode) to keep their backward compatibility on older x86 systems. Otherwise the application would run only on x64 systems but not on x86.
Forcing the application to run in x86 mode (even on x64 systems) allows to run ony any manchine no matter if its a 32 or 64 bit windows OS.