views:

246

answers:

4

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?

+2  A: 

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.

Brad Bruce
My test.exe won't run on w2k8 machine what to do??/
Cute
A: 

It should works, thanks to WOW64. You compiled as debug or release version? And can it find all the references that are you using?

Magnetic_dud
But my application wont run even i register the com using regasm.exe in w2k8 64 bit machine...
Cute
+1  A: 

The .NET framework built into Server 2008 is v3.0. Does your application require .NET v3.5? If so, you'll need to install the .NET 3.5 Redistributable package in Server 2008.

http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe

William Leara
A: 

What development environment are you using? It sounds like your projects are configured to use the C++ runtime DLL for a version that is not installed on the target box.

There should be a VC_Redist.exe somewhere in your development environment that you can copy and execute on the target box to install the necessary runtime assemblies.

Or, go to every project, EXE and DLLs, and ensure that the "Runtime Library" setting under the Project Properties->C/C++->Code Generation page is set to one of the non DLL options (/MTd or /MT). This will bypass the need to install a separate runtime on the target PC, but will make your EXEs and DLLs a bit larger.

Chris Becke