2
votes

I'm compiling a project which uses multiple DLL and compiles with VS2008. After a recent windows update DLLs compiled on my computer stopped working on other computers.

After some investigation it turned out that it updated the CRT redistributable library which I'm compiling with from version "9.0.21022.8" to version "9.0.30729.4148"

This is evident from the Manifest file of the EXE i'm compiling. it contains the following:

  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>

Meaning it wants to use two different versions of the CRT at the same time. the second version is needed by the code which I'm compiling right now and the first version is needed by older dlls which were compiled a few weeks ago.

In the computers where the application is deployed this becomes a problem since they get their CRT dll from a local folder called Microsoft.VC90.CRT and not from WinSXS. This folder can't contain two different versions of the dll.

Is there a known solution to this issue or do I need to start compiling all of the other DLLs with the new CRT?

1
I think I noticed the exact same issue last week. After a Windows Update a project that had built fine the previous day, no longer built. In fact it caused an ICE crash in the VS2008 compiler. A rebuild all fixed this. I never determined the precise cause, but it's not such a big deal for me as we haven't shipped yet.demoncodemonkey

1 Answers

0
votes

This is one of the many headaches caused by Side-by-Side Assemblies. Any time there is an update for Visual Studio, you really need to recompile all your code. Because there was a version change in the CRT, some of your code is using one DLL and the rest is using another.

Also, when distributing, you really need to distribute the CRT through merge modules or the appropriate installation set instead of copying the DLL's into the application folder. This will allow the program to look up the appropriate runtime(s) through WinSxS.

Finally, if you want to remove the problem altogether, like I did, you can modify all your projects to link statically with the CRT and recompile everything. This will completely remove the dependency on the runtime DLL - at least, with your own code. No more WinSxS to worry about here.