运行时主机到底是什么?

发布于 2024-08-21 13:35:45 字数 351 浏览 3 评论 0原文

Runtime Host 的确切定义是什么?

来自 MSDN

公共语言运行时旨在支持各种不同类型的应用程序,从 Web 服务器应用程序到具有传统丰富 Windows 用户界面的应用程序。每种类型的应用程序都需要一个运行时主机来启动它。运行时主机将运行时加载到进程中,在进程内创建应用程序域,并将用户代码加载到应用程序域中。

那么它是一个将运行时加载到另一个进程中的进程吗?
如何在任务管理器中查看它?

What is the exactly definition of Runtime Host?

From MSDN:

The common language runtime has been designed to support a variety of different types of applications, from Web server applications to applications with a traditional rich Windows user interface. Each type of application requires a runtime host to start it. The runtime host loads the runtime into a process, creates the application domains within the process, and loads user code into the application domains.

So is it a process which loads the runtime into another process?
How do I check it in Task Manager?

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

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

发布评论

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

评论(2

茶色山野 2024-08-28 13:35:45

不,它是一个将运行时 DLL(例如 mscoree.dll 等)加载到其进程空间中的进程。

所以只有1个进程空间。

所指的运行时实际上是.Net 运行时或 CLR。从简化的传统操作系统的角度来看,CLR 实际上只是一组 DLL。因此,您需要一个操作系统进程来加载并执行该 DLL 的入口点。这个托管可执行文件是您的运行时主机。实际上,.Net 运行时主机为 CLR 做了很多事情(请参阅托管概述

您提到了 MSDN,所以我猜您已经查看了 运行时主机就在那里。您可以看到他们给出的示例都是托管 CLR(DLL)的可执行文件。

希望有帮助。

No, it's a process that loads the runtime DLLs ( e.g. mscoree.dll, etc ) into its process space.

So there is only 1 process space.

The runtime that is referred to is really the .Net runtime or CLR. And from a simplified traditional OS point of view, the CLR is really just a set of DLLs. So, you need a OS process to load and execute the entry point of that DLL. This hosting executable is your runtime host. In reality the .Net runtime host does a lot of things for the CLR ( See Hosting Overview )

You mentioned MSDN, so I guess you've looked at Runtime Hosts on there. You can see the examples they give are all executables that host the CLR ( DLLs ).

Hope that helps.

因为看清所以看轻 2024-08-28 13:35:45

本文可能会有所帮助:实现自定义运行时主机。它讨论了主机的各个方面以及您何时/为何想要实现自己的主机。

直接摘自文章:
.NET Framework 附带的主机示例包括:

  • ASP.NET:附带的 ISAPI 过滤器
    与 ASP.NET 负责
    启动CLR并初始化
    路由 Web 请求所需的管道
    到 ASP.NET 进程。
  • Internet Explorer:.NET Framework 发布
    带有一个挂钩的 MIME 过滤器
    Internet Explorer 5.01 或更高版本
    执行托管代码控制
    从 HTML 页面引用。
  • Shell 可执行文件:每次
    可执行文件是从启动的
    shell,一小块不受管理的
    调用转换的代码
    控制权交给 CLR。

其他主机可能包括:

  • 数据库引擎 未来版本
    Microsoft SQL Server 将允许
    要写入的存储过程
    支持 .NET 的语言
    框架并执行
    CLR。
  • 个人记事本 若干
    电子邮件/日历/联系程序
    允许用户编写脚本
    定制电子邮件的处理
    消息、约会等。
    很容易想象这些脚本
    运行在 CLR 上。保安
    CLR提供的系统是
    在这种情况下尤其重要
    因为扩散
    通过电子邮件系统传播的病毒。

This article might help: Implementing a custom runtime host. It discusses the various aspects of the host and when/why you might want to implement your own.

Lifted directly from the article:
examples of hosts that ship with the .NET Framework include:

  • ASP.NET: An ISAPI filter that ships
    with ASP.NET is responsible for
    starting the CLR and initializing the
    plumbing needed to route Web requests
    to the ASP.NET processes.
  • Internet Explorer: The .NET Framework ships
    with a MIME filter that hooks into
    Internet Explorer 5.01 or later to
    execute managed code controls that
    are referenced from HTML pages.
  • Shell Executables: Each time an
    executable is launched from the
    shell, a small piece of unmanaged
    code gets invoked that transitions
    control to the CLR.

Other hosts could include:

  • Database Engines A future version of
    Microsoft SQL Server will allow
    stored procedures to be written in
    languages that support the .NET
    Framework and are executed with the
    CLR.
  • Personal Organizers Several
    e-mail/calendar/contact programs
    allow users to write scripts to
    customize the processing of e-mail
    messages, appointments, and so on.
    It's easy to imagine these scripts
    running on the CLR. The security
    system provided by the CLR is
    especially important in this scenario
    because of the proliferation of
    viruses spread by e-mail systems.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文