Visual Studio托管过程的目的是什么? [英] What is the purpose of the Visual Studio Hosting Process?

查看:119
本文介绍了Visual Studio托管过程的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio调试程序时,将为您提供Enable the Visual Studio hosting process的选项.此选项的目的是什么?有什么作用?

When debugging a program using Visual Studio you are given the option to Enable the Visual Studio hosting process. What is this purpose of this option and what effect does it have?

推荐答案

MSDN库没有提供有关托管过程"的很好的信息. Eric链接中列出的最后两个功能实际上是由该功能引起的问题.早晚您肯定会遇到另一个问题:它使用了一个不同的app.config文件.活动文件名为yourapp.vshost.exe.config.手动更改文件时请注意这一点.

The MSDN library doesn't give very good info on the "hosting process". The last two features listed in Eric's link are actually problems induced by the feature. There's another one that you're bound to run into sooner or later: it uses a different app.config file. The active one is named yourapp.vshost.exe.config. Watch out for this when you make manual changes to the file.

它支持的另一个功能在调试应用程序时非常明显,但Console.Write()产生的输出发生了什么,却未曾提及.在非控制台模式的应用程序中,它将被重定向到IDE的输出"窗口.非常有用.

Another feature it supports that's very visible when you debug your app but isn't mentioned anywhere is what happens to the output produced by Console.Write(). In a non-console mode app, it gets redirected to the IDE's Output window. Very useful.

术语托管"是指CLR的功能,可以托管".自定义CLR主机的示例是SQL Server和ASP.NET.托管允许在启动CLR之前对其进行配置.一种主要用途是配置主要AppDomain并设置自定义安全策略.这正是托管过程正在做的事情.

The term "hosting" refers to a feature of the CLR, it can be "hosted". Examples of custom CLR hosts are SQL Server and ASP.NET. Hosting allows one to configure the CLR before it gets started. One primary use of this is configuring the primary AppDomain and setting up custom security policies. Which is exactly what the hosting process is doing.

有关此问题的详细示例,请参见此问题.

A good example of a custom CLR host is available in this question.

长话短说:在调试模式下,您运行的是自定义版本的CLR,可以改善调试体验.

Long story short: in debug mode you are running with a customized version of the CLR, one that improves the debugging experience.

这篇关于Visual Studio托管过程的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆