0

I have 3 projects in my solution explorer. 2 Windows applications and 1 class library, that shall be used by both applications. One application ist compiled to x86, the other one to x64. Is it possible to make the DLL available for both? Or do I need to make 2 libraries with different settings?

Daniel
  • 511
  • 10
  • 25

1 Answers1

1

Coding for the .NET framework doesn't usually require you to specify the architecture of the CPU your code is going to run on, because the framework itself compiles the IL at runtime for the platform it is being executed on. You usually need to "force" the architecture only in case you have to use some external assembly or COM components or libraries that are compiled for a specific platform, like you're running on a x64 machine but you need to use a 32bit COM component, therefore you must force your app to be compiled in 32bit mode (that is probably your case I suppose since you are defining the specific architecture for your projects). Anyway you can leave the DLL setting as "Any CPU" because the framework will choose for you the appropriate one according on the process that'll be loading the DLL. I hope this helps!

Leonardo Spina
  • 680
  • 6
  • 15