tags:

views:

403

answers:

2

Hey All,

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?

+1  A: 

Maybe this will be of some help -

http://blogs.msdn.com/clrteam/archive/2009/06/03/in-process-side-by-side-part1.aspx

+2  A: 

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:

<configuration>
   <startup>
      <supportedRuntime version="v4.0.20506"/>
   </startup>
</configuration>

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?

Richard Szalay
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
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
(by 2.0 I mean 2.0 - 3.5)
Richard Szalay
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