.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using 32 or 64-bit DLL with AnyCPU DLL

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :.NET Framework
Hi All,

First of all, I'm sorry if it is not the right place for this question... It was the one I though was the most appropriate.

I have a 3rd party DLL that has two versions, a 32 and a 64-bit version.

I was wondering if I could create an AnyCPU DLL that would use both versions depending on the context.

If I am in a x64 environment, I would have the two versions put in the GAC (GAC_32 and GAC_64) and my DLL put in the GAC_MSIL. Now, if I launch my DLL using a 32-bit program, will the dependency will be resolved with the 32-bit DLL? And if I launch my DLL using a 64-bit program, will the dependency will be resolved with the 64-bit DLL?

I hope this is clear enough...

Thank you,


View Complete Post

More Related Resource Links

AnyCpu, x32bit, x64bit ? What are the differences?


Hi Folks,

   can someone explain the differences between compiling an application with the AnyCpu or x32bit or x64bit compile options?


   I can guess what the differences with x32bit vs x64bit are .. but what about AnyCpu? Like, why would i create an application (eg. website or class library dll) targetted against x32 explicitly or x64 explicity instead of just building all my programs with AnyCpu? Does AnyCpu increase the dll size as opposed to explicit targetting at the cost of the dll not working on the other type of architecture?

EXE in 32bit and DLL compiled for anyCPU


Our application is one EXE and multiple DLL's. Right now, we are compiling all of them for x86 so we are forcing 32bit because the running size of the application is a lot smaller (memory usage).

If we compile the EXE as x86 and the DLL's as anyCPU, on a 64bit machine will the DLL's be 32bit or 64bit?

the reason for my question is if i can compile the DLL's for anyCPU and then have two EXE's, one for 32bit and one for 64bit, then i have only one duplicate program for the 32 or 64 bit change, and if a user wants to run full 64bit they only need to run the 64bit EXE and everything is fine. But if a user is on a 64bit machine but wants to run in 32bit mode, they would run the 32bit EXE.

Let me know if this is true. i can't test this as i develop on a 32bit XP machine.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend