0

I've been scouring the web for information on this and cannot come to a safe conclusion without finding a maching with none of the CRT dll's installed. My application is very small and I don't want to burden users with potentially bloated installs or the appearance of downloading stuff they don't need.

I'm tempted to just include the 220kb msvcm90.dll (C Runtime import library compiled as 100% pure MSIL code. All code complies with the ECMA URT spec for MSIL) and 2kb Microsoft.VC90.CRT.manifest in the application's directory. But , http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=VS.90%29.aspx, states that those are now stored in the global assembly cache.

Can someone please verify my proposed solution?

A lot of what I've said is reinforced by this post, Visual C++ Redistributables without using VCRedist_x86.exe, but while he has upvotes I'm still to be convinced by the sound of independent testimony.

Please could answers make reference to my manifest which has just the one dependency:

<dependency>
  <dependentAssembly>
    <assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='idontknowenuff' />
  </dependentAssembly>
</dependency>

As this doesn't specify just the managed runtime, it looks like my solution won't work without full installation (a 4Mb download from MS).

To further complicate things, the version of the runtime in my VC/redist directory is, 9.0.30729.1, but I assume it will be backwards compatible.

Community
  • 1
  • 1
John
  • 6,433
  • 7
  • 47
  • 82
  • Your code also won't work without the 3 gigabyte Windows download, you can't sweat the small stuff when you take a dependency on managed code. Like Windows, ask your customer to preinstall the dependencies if you don't want to do it. The manifest already gets embedded in the DLL, don't write your own. The runtime DLL goes in the side-by-side cache, not the GAC. That gets checked at runtime, you can't mess with it. VS2010 again supports app-local deployment. – Hans Passant Sep 20 '11 at 12:18
  • Ok Hans, I agree totally. I checked with ILDASM and MSVCR90.DLL is there adjacent to MSVCM90.DLL. As they already need .NET this is no biggy, had hoped that biggie would've covered all my bases though. What about versioning of the MSVCRT redistributable, will it be backwards compatible from 9.0.3xx to 9.0.2xx? – John Sep 20 '11 at 12:22
  • Yes, 9.0.30729 is the SP1 release. There have been several security updates since then. Installing the runtime also deploys publisher policy files that map the version. – Hans Passant Sep 20 '11 at 12:34
  • I'm not so concerned with where they are installed, only that they are installed, I think you are saying that as side by side installs they are unshared and in the application's Program Files's folder (if so I wonder if cache is an appropriate term, with connatations of desirable, reusable, possibly shared space?) http://msdn.microsoft.com/en-us/library/ms235342%28v=vs.80%29.aspx – John Sep 20 '11 at 12:35
  • They *are* shared. Which is the point of all this hassle, DLL Hell is prominent with shared DLLs. Google 'windows side-by-side cache' to learn more about how this works. – Hans Passant Sep 20 '11 at 12:39

2 Answers2

0

Google books turned up:

"If you compile code that uses the CRT with either the /clr option or the /clr:pure option, you'll get the appropriate pure MSIL CRT linked in instead of the native CRT", Gordon Hogenson - 2006

This seems wrong, as ILDASM shows ".module extern MSVCR90.dll" as the first line of the embedded manifest. I'll leave this answer here for GC or as a reminder that not everything that is published is gospel.

John
  • 6,433
  • 7
  • 47
  • 82
0

If you run in the debugger (enable mixed managed + native debugging), the modules window should show what DLLs get loaded while your program runs.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • Ah, now I see that in VC2008 Express, just need to start debugging again. Pretty sure MSVCM90.dll is a wrapper for MSVCR90.dll though, ILDASM listed them both. – John Sep 24 '11 at 23:36