C# – Can a Windows Server 2003 32-bit machine application work for a Windows Server 2008 64-bit machine

ccomdebuggingwindowswindows-server-2008

I am using a Windows Server 2003 32-bit machine. Using that machine I have created a COM component and consumed it in another application and have an EXE file.

Now I copy that EXE to another machine installed with Windows Server 2008, 64-bit.

And when I try to run that EXE it shows something like "Debug Error: This application needs runtime and terminates in an unusual way".

Is the bitness (32-bit vs 64-bit) compatibilty the reason for this? What could I need to run this on a Windows Server 2008 machine?

Best Answer

When you compile your app, you need to make sure that you compile it for 32 bit. By default, Visual Studio compiles for "Any". This leads to some parts of your app being 32 bit and using 64 bit DLLs.