Re: C# 64-bit DLL?



"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 Studio
2005? I only find a setting names for Any CPU in project --> properties.

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

Willy.

.



Relevant Pages

  • SNMP on X64
    ... I am working on SNMP agent dll development on Windows x64 and x86 ... I am able to successfully develop it on x86 platform on ... The problem lies in x64 platform. ...
    (comp.protocols.snmp)
  • Re: Better architecture for cross-platform project
    ... would simply be for a UI that leverages the shared DLL. ... Obviously each platform must have it's own main Form ... > multiple project files for the same set of source files, ... > Then I came up with an idea of creating an abstract class subclassing ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: problems with 3d sound using directmusic
    ... > Above is the overall design of my current project, the platform can run ... > different game depend on user choice. ... The sound engine maintain a static ... but the wave file loaded and played by game dll do not come ...
    (microsoft.public.win32.programmer.directx.audio)
  • problems with 3d sound using directmusic
    ... Above is the overall design of my current project, the platform can run ... different game depend on user choice. ... The sound engine maintain a static ... but the wave file loaded and played by game dll do not come ...
    (microsoft.public.win32.programmer.directx.audio)
  • error while hosting asp.net in managed c++ dll.
    ... listener if the platform is win2k or xp, ... c# dll. ... HttpWorkerRequest and properly maps the directory to where I have my ...
    (microsoft.public.dotnet.languages.vc)