Take the 2-minute tour ×

I am currently developing an MMC snap-in but have hit a big snag - it's done using the .Net 4.0 framework; and MMC is loading a previous version of the runtime.

Using an older version of the runtime isn't really an option, as the entire project is written for 4.0 (so far 5000 LOC); this is merely a management front-end (fancy that :P).

I checked the MMC registry key and it has version v4.0.20506 there. I can't find any other MMC .Net interop configuration anywhere.

Any ideas?

share|improve this question
I am assuming you are using Dev10 to develop your addin, right? also are you running on a 64 bit machine? –  mfawzymkh Jul 21 '09 at 5:10
@mfawzymkh yep - that is where I am sitting –  Jonathan C Dickinson Jul 21 '09 at 14:13
add comment

4 Answers

up vote 3 down vote accepted

Having read up on the matter a bit further, I can confirm that the host process must explicitly support multiple runtimes via some new APIs in .NET 4.0.

I doubt MMC (even in Windows 7) supports these APIs, since .NET 4.0 is also in beta. In the unlikely chance that it does, you can force it to use it by using the supportedRuntime element in your configuration:

      <supportedRuntime version="v4.0.20506"/>

Failing that, however, I'm afraid you are out of luck. Your only choice then will be to change your project to target .NET 2.0.

Alternatively, you could write an unmanaged MMC snap-in that hosts it's own runtime and loads your managed one. How badly do you need those .NET 4.0 features?

share|improve this answer
Thanks. I am going to give this a shot - how badly do I need them? 6000 LOC that I wrote personally that have since been upgraded to Framework 4... –  Jonathan C Dickinson Jul 22 '09 at 10:16
How many of those lines have a .NET 4.0 dependency? Are you using EF4, WF4, the dynamic keyword or any of the new APIs? If not, you can probably run against 2.0 with very few changes. –  Richard Szalay Jul 22 '09 at 10:41
(by 2.0 I mean 2.0 - 3.5) –  Richard Szalay Jul 22 '09 at 10:41
Nope - not going to 2.0. I had a bunch of custom classes (e.g. thread-safe collections) that are now in the framework; so I got rid of them. On top of that I am not (yet) using dynamic, but will be. I guess it will have to wait for an update. Thanks for the help though. Well earned bounty! –  Jonathan C Dickinson Jul 22 '09 at 10:51
add comment

...or you can force MMC to use v4.0 with following environment variable:

set COMPLUS_Version=v4.0.30319
share|improve this answer
add comment

Microsoft has since posted this article regarding MMC and CLR versions http://msdn.microsoft.com/en-us/library/windows/desktop/gg983006(v=vs.85).aspx Basically, you create a magical environment variable that directs the CLR startup to a configuration file that is specific to your MMC snap-in.

Personally, I think it would have made everyone's lives easier if they would have simply changed MMC.EXE to use CLR 4 but for some reason they decided to not go that direction.

share|improve this answer
add comment

Your Answer


