Re: C# 64-bit DLL?
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Fri, 19 Oct 2007 12:08:40 +0200
"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D91632D8-991B-4DF7-A5CE-C2A92EBD1511@xxxxxxxxxxxxxxxx
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,
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.
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?
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).
2. If we have to make two separate builds, how to do it in Visual StudioYou should have AnyCpu, X86, X64 and Itanium, what version of VS2005 are you running?
2005? I only find a setting names for Any CPU in project --> properties.
Willy.
.
- Follow-Ups:
- Re: C# 64-bit DLL?
- From: George
- Re: C# 64-bit DLL?
- References:
- C# 64-bit DLL?
- From: George
- C# 64-bit DLL?
- Prev by Date: Re: Grid Class and build a view for it
- Next by Date: Re: Type convertsion from string
- Previous by thread: C# 64-bit DLL?
- Next by thread: Re: C# 64-bit DLL?
- Index(es):
Relevant Pages
|