I am having a hard time trying to compile my app to target both 32- and 64-bit frameworks.

The application and many assemblies are compiled as AnyCPU but I have some Managed C++ DLL that are compiled as both 32- and 64-bit DLLs. When I add a reference to a MC++ DLL in my AnyCPU application I cannot choose both 32- and 64-bit DLLs but only one of them. Thus if I reference the 32-bit DLLs I can compile the app to make it operate properly on the 32-bit framework and if I reference the 64-bit DLLs I can compile it to operate properly on 64-bit. But I would like to use a batch build to compile for both plateform simultaneously... Should I use Pre-build events to manually copy the right DLLs before compilation

I am also wondering how it works with Stong Names. If my app is compiled as AnyCPU and target a 32-bit MC++ DLL it will target a different strong name than the same app that target the 64-bit DLL... Is there a way to have the exact same binary app that can load 32-bit MC++ DLLs on a 32-bit environment and 64-bit DLLs on a 64-bit environment



Re: 64-Bit .NET Framework Development. Compiling both 32- and 64-bit assemblies with strong names

Ryan Lamansky / Kardax

There's no way that I'm aware of. You can sorta fake it if you ship two separate builds side-by-side, put an AnyCpu managed loader in front of the application that checks IntPtr.Size to decide whether to launch the 32-bit or 64-bit version of your app.

-Ryan / Kardax