1
votes

Still trying to fix this:

Problem loading C runtime library from executable and DLL

My problem is my C++ DLL compiled with CLR (.net 3.5, in Visual Studio 2008) doesn't access the C runtime DLLs (msvcr90.dll, msvcm90.dll and msvrp90.dll) from the winSxS folder, when that DLL is loaded from my C# WPF application.

It does find the C runtime DLLs from winSxS is the DLL is loaded from a C++ command line tool.

It seems like I need to modify my DLL's manifest file to fix this. How can I do this?

1
You probably should update your original question instead of creating a duplicate.Frédéric Hamidi
Well it's the same problem I'm trying to solve, but I'm asking a different question.Warpin
Same question, same answer. You haven't followed up on the hints given in the comments, just reposting the question is pointless.Hans Passant

1 Answers

0
votes

Here is what I had to put in the manifest to force a specific version of the runtime DLLs. Because they are present in the SxS folder on my machine, they are loaded from that location:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4926" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
    </dependentAssembly>
  </dependency>

[...]