MMC .Net 运行时版本

发布于 2024-07-27 00:16:24 字数 257 浏览 1 评论 0原文

我目前正在开发一个 MMC 管理单元,但遇到了一个大障碍 - 它是使用 .Net 4.0 框架完成的; 并且 MMC 正在加载运行时的早期版本。

使用旧版本的运行时并不是真正的选择,因为整个项目是为 4.0 编写的(到目前为止 5000 LOC); 这只是一个管理前端(想象一下:P)。

我检查了 MMC 注册表项,它的版本为 v4.0.20506。 我在任何地方都找不到任何其他 MMC .Net 互操作配置。

有任何想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

生活了然无味 2024-08-03 00:16:24

进一步阅读了这个问题后,我可以确认主机进程必须通过 .NET 4.0 中的一些新 API

我怀疑 MMC(即使在 Windows 7 中)是否支持这些 API,因为 .NET 4.0 也处于测试阶段。 万一出现这种情况,您可以通过在配置中使用supportedRuntime 元素来强制它使用它:

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

但是,如果做不到这一点,恐怕您就不走运了。 那么您唯一的选择就是将您的项目更改为面向 .NET 2.0。

或者,您可以编写一个非托管 MMC 管理单元,托管其自己的运行时并加载您的托管管理单元。 您有多需要这些 .NET 4.0 功能?

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?

雨后咖啡店 2024-08-03 00:16:24

...或者您可以强制 MMC 使用 v4.0 和以下环境变量:

set COMPLUS_Version=v4.0.30319

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

set COMPLUS_Version=v4.0.30319
青巷忧颜 2024-08-03 00:16:24

Microsoft 此后发布了有关 MMC 和 CLR 版本的文章 http://msdn.microsoft.com/en-us/library/windows/desktop/gg983006(v=vs.85).aspx
基本上,您创建一个神奇的环境变量,将 CLR 启动引导到特定于 MMC 管理单元的配置文件。

就我个人而言,我认为如果他们只是将 MMC.EXE 更改为使用 CLR 4,那么每个人的生活都会变得更轻松,但由于某种原因,他们决定不朝这个方向发展。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文