C#64位DLL?

扫码查看
本文介绍了C#64位DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我使用C#开发使用Visual Studio 2005和.Net 2.0的DLL,而且我不知道如何使我的DLL工作在64位平台上使用应用程序。

最重要的是,我没有在我的64位DLL中使用任何新功能。所以,我希望

来检查一般规则,


1.对于C#,是否需要进行两个单独的构建(32位和64位) -bit)

根据使用DLL的应用程序(32位还是64位)?即
提供我的64位C#DLL的64位应用程序,并提供32位应用程序

在我的32位DLL的64位平台上运行?


2.如果我们必须制作两个单独的版本,如何在Visual Studio中完成它?
2005?我只找到项目中任何CPU的设置名称--properties。

提前感谢,

George

解决方案



检查你的项目构建属性,默认平台目标选项是

设置为* AnyCpu *,这意味着你的DLL将在64位进程中加载​​

时运行为64位,加载时为32位在32位进程中。



不,在构建DLL时,最好保留默认的平台

(AnyCpu)。

在讨论可执行程序集时,事情会变得复杂一些。

如果你的应用程序真的需要扩展的寻址范围

64bit Windows ,那么你必须构建你的exe作为64位应用程序

(平台= X64或IA64,具体取决于平台),这样的应用程序无论如何都不能在X86上运行
。 br />
但是,如果您不需要扩展寻址功能而且您不需要在IA64上运行
,那么您最好将平台设置为X86 ;。这样,你的应用程序在所有Windows平台(IA32和X64)上以32位运行。



你应该有AnyCpu,X86,X64和Itanium,你是什么版本的VS2005? />
正在运行?


Willy。




检查你的项目构建属性,默认平台目标选项是

设置为* AnyCpu *,这意味着你的DLL将在64位进程中加载​​

时运行为64位,加载时为32位在32位进程中。



不,在构建DLL时,最好保留默认的平台

(AnyCpu)。

在讨论可执行程序集时,事情会变得复杂一些。

如果你的应用程序确实需要扩展的寻址范围,那么你需要使用

64位Windows构建你的exe作为64位应用程序

(平台= X64或IA64,具体取决于平台),这样的应用程序无论如何都不能在X86上运行。

但是,如果您不需要扩展寻址功能并且您不需要在IA64上运行
,那么您最好将平台设置为X86。这样,你的应用程序在所有Windows平台(IA32和X64)上以32位运行。



你应该拥有AnyCpu,X86,X64和Itanium,你用什么版本的VS2005

运行?


Willy。



检查项目构建属性,默认的平台目标选项
设置为* AnyCpu *,这意味着你的DLL在64位进程中加载​​时将作为64位运行,而在32位加载时运行为32位进程。


不,在构建DLL时,最好保留默认的平台
(AnyCpu)。
在谈论可执行程序集时,事情会变得更复杂。
如果您的应用程序确实需要
64位提供的扩展寻址范围Windows,那么你必须构建你的exe作为64位应用程序
(平台= X64或IA64,具体取决于平台),这样的应用程序无论如何都无法在X86上运行。
但是,如果您不需要扩展寻址功能并且您不需要在IA64上运行,那么您最好将平台设置为X86。这样,你的应用程序在所有Windows平台(IA32和X64)上运行为32位。


你应该有AnyCpu,X86,X64和Itanium,什么版本VS2005是运行吗?

威利。



Hello everyone,
I am using C# to develop DLL using Visual Studio 2005 and .Net 2.0, and I
have no idea of how to make my DLL work with applications on 64-bit platform.
Above all, I do not utilize any new features in my DLL of 64-bit. So, I want
to check the general rules,

1. For C#, is there a need to make two separate builds (32-bit and 64-bit)
according to the application (32-bit or 64-bit) which uses the DLL? i.e.
provide 64-bit application my 64-bit C# DLL, and provide 32-bit application
runs on 64-bit platform my 32-bit DLL?

2. If we have to make two separate builds, how to do it in Visual Studio
2005? I only find a setting names for Any CPU in project --properties.
thanks in advance,
George

解决方案

Check your Project Build Properties, the default Platform target option is
set to *AnyCpu*, which mean that your DLL will run as a 64 bit when loaded
in a 64 bit process and as 32 bit when loaded in a 32 bit process.

No, when building a DLL you better keep the default Platform as is
("AnyCpu").
When talking about an executable assembly things get a bit more complicated.
If your application really needs the extended addressing range offered by
64bit Windows, then you have to build your exe as a 64 bit application
(Platform = X64 or IA64 depending on the platform), such application cannot
run on X86 anyway.
However, if you don''t need the extended addressing capability AND you don''t
need to run on IA64, then you better set the Platform to "X86". This way,
your appplication runs as 32 bit on all Windows platforms (IA32 and X64).

You should have AnyCpu, X86, X64 and Itanium, what version of VS2005 are you
running?

Willy.



Check your Project Build Properties, the default Platform target option is
set to *AnyCpu*, which mean that your DLL will run as a 64 bit when loaded
in a 64 bit process and as 32 bit when loaded in a 32 bit process.


No, when building a DLL you better keep the default Platform as is
("AnyCpu").
When talking about an executable assembly things get a bit more complicated.
If your application really needs the extended addressing range offered by
64bit Windows, then you have to build your exe as a 64 bit application
(Platform = X64 or IA64 depending on the platform), such application cannot
run on X86 anyway.
However, if you don''t need the extended addressing capability AND you don''t
need to run on IA64, then you better set the Platform to "X86". This way,
your appplication runs as 32 bit on all Windows platforms (IA32 and X64).

You should have AnyCpu, X86, X64 and Itanium, what version of VS2005 are you
running?

Willy.



Check your Project Build Properties, the default Platform target option
is
set to *AnyCpu*, which mean that your DLL will run as a 64 bit when
loaded
in a 64 bit process and as 32 bit when loaded in a 32 bit process.


No, when building a DLL you better keep the default Platform as is
("AnyCpu").
When talking about an executable assembly things get a bit more
complicated.
If your application really needs the extended addressing range offered by
64bit Windows, then you have to build your exe as a 64 bit application
(Platform = X64 or IA64 depending on the platform), such application
cannot
run on X86 anyway.
However, if you don''t need the extended addressing capability AND you
don''t
need to run on IA64, then you better set the Platform to "X86". This way,
your appplication runs as 32 bit on all Windows platforms (IA32 and X64).

You should have AnyCpu, X86, X64 and Itanium, what version of VS2005 are
you
running?

Willy.



这篇关于C#64位DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 16:27
查看更多