3
votes

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

3

3 Answers

6
votes

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

1
votes

The problem is that the EXE requires the debug CRT DLLs and they are not present on the 2008 machine. How you fix this depends on what you want/need to do.

If you want to use the debug CRT, either link statically to the CRT (removing the need to have the DLLs on the 2008 machine) or create a directory called "Microsoft.VC80.DebugCRT" in the same directory as the EXE, and put the necessary DLLs and the debug CRT manifest file there.

The debug CRT is not redistributable, AFAIK there is no way to "install the debug CRT" other than installing all of Visual Studio.

If you don't actually need the debug CRT, link with the release version. Again, you'll need to choose between the static LIB and the DLL version. The good news is that the release CRT is redistributable, check your Visual Studio install directory for vcredist_x86.exe.

1
votes
  1. Don't ship debug builds. Build it in release, and then put that on your target machine.
  2. If you use the CRT (you do) then you need to install the CRT redistributables. You need to install (on the target machine) the ones which match the version & SP of the compiler you used to build the application. It's very simple & standard practice

Here's a link where you can get the redists for VC8: link And here's a link for the redists for VC8 SP1: link text

Just google "vc8 redist" or whichever version you are using and you will find your way.

  1. Don't statically link your app just to avoid having to install the redists.