Share via


Troubleshooting C/C++ Isolated Applications and Side-by-side Assemblies - Scenario based with solutions

I am a support Engineer and has handled large number of cases related to C/C++ Isolated applications and side-by-side assemblies.

I came across different errors and is able to find resolution with the help of my Escalation Engineers. Here is the list of errors along with the solution. I hope this will help my team mates or users who has same set of errors.

I always suggest one to go thru https://msdn2.microsoft.com/en-us/library/ms235342.aspx .
In Most of the cases the above link is sufficient enough to find out the solution.

Scenario 1:

C Run-Time Error R6034
Error Message
"An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."

In VC++ 2005, you need an application manifest to make use of the CRT (msvcr80[d].dll). If your application or DLL using CRT DLL doesn't have a manifest, you get this error.

Solution
Rebuild your application with a manifest
https://msdn2.microsoft.com/en-us/library/ms235560.aspx

Scenario 2:

Error Message
The application failed to initialize properly (0xc0000135).
This application has failed to start because the application configuration is incorrect. Reinstalling application may fix this problem.
The system cannot execute the specified program.

If a manifest is present in your application but a required Visual C++ library is not installed in the WinSxS folder, you may get one of the above error messages depending on the version of Windows on which you try to run your application:

Solution
Event viewer will have more details that will help us in finding a solution.

Scenario 3:

Error Message
This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem.

Typically this error occurs because you are mixing retail and debug components. A very common scenario is a debug build of a application which is pulling in a retail version of a static library. The scenario could be the exact reverse and the error message in this case would reference msvcr80d.dll

Solution
This can be worked around by adding reference to retail CRT in the application manifest manually. Or by adding the following to a header.

#pragma comment(linker, "\"/manifestdependency:type='Win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'\"")

Note: Proceed with caution when providing this solution.

Scenario 4:

ErrorMessage
Though there are no runtime errors,there might be errors in event viewer
like

Component identity found in manifest does not match the identity of the component requested Syntax error in manifest or policy file

"C:\Client\Microsoft.VC80.MFC.MANIFEST" on line 4. Generate Activation.Context failed for C:\Client\test.dll. Reference error message: The operation completed successfully

 

There are 2 bugs which cause this.

1. The assembly manifest of Microsoft.VC80.MFCLOC is incorrect. It has version 8.0.50727.42 instead of 8.0.50608.0.

Solution
Change the version number

<assemblyIdentity type="win32" name="Microsoft.VC80.MFCLOC" version="8.0.50727.42" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"/>

should be changed to
<assemblyIdentity type="win32" name="Microsoft.VC80.MFCLOC" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"/>

2. Microsoft.VC80.MFCLOC is referenced not by the application but by MFC80[ud].dll
 
Solution
Microsoft.VC80.MFCLOC directory has to be under Microsoft.VC80.MFC directory and not at the same level.

Scenario 5:
Works in Windows XP but not in Windows Server 2003 or vice versa
. On Windows XP the stand alone manifest overrides the embedded manifest where as in Windows Server 2003 the embedded manifest always overrides the stand alone manifest.

It is recommended to have embedded manifest with correct information.
This will also avoid the overhead of shipping external manifest.

Scenario 6:
Can't find the MSM for ia64 under C:\Program Files\Common Files\Merge Modules.

Solution
Make sure you have installed one of the Team Editions and that you have selected the tools for building ia64 and merge modules in setup. The Professional SKU does not have ia64 support.

Scenario 7:
VS 2005 setup did not install the RTM version of MSM for libraries in \Program Files\Common Files\Merge Modules. Or the MSM under \Program Files\Common Files\Merge Modules indicate they are for beta2. In explorer, hovering over the VS 2005 MSMs shows tooltips which shows "WinSxS Beta 2".

Solution

This is bug in the MSMs. Even though there are RTM they were mislabeled with "WinSxS Beta 2".  The version should still show 8.0.50727.42. You can find the version by adding the MSM to a setup project and checking version under properties. There is a QFE which updates this label if customer needs it - KB 911884.