C# – application has failed to start because the side by side configauration is incorrect

csql servervisual c++windows-server-2008

HI
I have creted an exe by c++ using visualstudio. I have creted a com componet which discover all the instances of sqlserver on particular machine.now in c++ program using visualstudio i write main() and consume the com component.

Now it should worrk on my both workstations which are w2k3 machines.And when i try to run the same on w2k8 machine i got the error as

the application has failed to start because the side by side configauration is incorrect and for details see the application event error log

i open the application error log and found the error as

Activation context generation failed for "E:\SQLDiscovery.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0" could not be found. Please use sxstrace.exe for detailed diagnosis.

How to resolve this one plz help me

Best Answer

You have to install the VC8 Runtime on W2k8. This is due to Windows Side by Side configuration. When you build and EXE, a special file is generated called "manifest", this manifest file describe the version of the C runtime library that is needed by your application in order to run correctly.
The Manifest is then embedded into your exe/dll ( if you actually opened the .dll/exe using notepad and scrolled to the end, you will see it in xml format), you cal also use mt.exe ( manifest tool ) to view the manifest inside any executable.

When you move your application to W2k8, you have to ensure the dependent CRT is installed ( unless you statically link your app with CRT).

You can resolve this issue by either one of these 1- Install VC8 Debug CRT 2- Build you app as statically linked

Check out this blog as well http://detritus.blogs.com/lycangeek/2006/08/diagnosis_of_wi.html It contains useful information about how to debug winsxs issues.

Hope this helps