本文介绍了设置32位x86构建目标在Visual C#2008 Express Edition的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立加载32位COM DLL C#应用程序。编译应用程序运行正常在32位Windows,但barfs在64位的Windows,因为它无法加载32位COM。有没有一种方法来设置VC#2008 Express Edition的32位版本的目标是什么?

I'm building a C# application that loads a 32-bit COM dll. The compiled application runs fine on 32-bit Windows but barfs on 64 bit Windows because it can't load the 32-bit COM. Is there a way to set a 32-bit build target in VC# 2008 Express Edition?

另外,有办法迫使编译成一个.NET应用程序的值为anycpu 的建设目标为在32位模式下在64位Windows上运行?

Alternatively, is there a way to force a .NET application compiled to the AnyCPU build target to run in 32-bit mode on 64-bit Windows?

推荐答案

您不能明确其设置为32位,在VS Express中的UI,但显然(我只有手头的专业版),它可以使用位设置来完成。 论坛后,对如何做到这一点的详细信息。

You cannot explicitly set it to 32-bit in the UI in VS Express, but apparently (I only have the Professional version at hand) it can be done using a bit of setting up. This forum post has details on how to do it.

您也可以做的是使用自带的工具来设置编译的输出作为32位运行。

What you can also do is to use the CorFlags tool that comes with the .Net Framework SDK to set the compiled output to run as 32-bit. To set the 32-bit flag using CorFlags, run this from the command line:

CorFlags.exe /32BIT+ yourapp.exe

这将设置你的exe文件的头中的标记信号到.NET,它应该被作为运行32位。

This will set a flag in the header of your exe to signal to .Net that it should be run as 32-bit.

这篇关于设置32位x86构建目标在Visual C#2008 Express Edition的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 12:48