与 .NET 程序集文件一起出现的 XML 文件是什么? [英] What's the XML file that comes together with a .NET assembly file?

查看:20
本文介绍了与 .NET 程序集文件一起出现的 XML 文件是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多 .NET 程序集都带有一个 XML 文件.例如,System.Web.WebPages.Razor.dll 与包含以下内容的 System.Web.WebPages.Razor.xml 一起提供:

Many .NET assemblies are accompanied with an XML file. For example, System.Web.WebPages.Razor.dll comes together with System.Web.WebPages.Razor.xml that contains the following:

<?xml version="1.0" encoding="utf-8" ?> 
<doc>
   <assembly>
       <name>System.Web.WebPages.Razor</name> 
   </assembly>
   <members>
       <member name="T:System.Web.WebPages.Razor.PreApplicationStartCode" /> 
       <member name="M:System.Web.WebPages.Razor.PreApplicationStartCode.Start" /> 
       <member name="T:System.Web.WebPages.Razor.RazorBuildProvider" /> 
       <member name="M:System.Web.WebPages.Razor.RazorBuildProvider.#ctor" />
        Much more elements follow...
   </members>
</doc>

这个 XML 有什么用?我在运行时需要它吗?

What's this XML for? Do I need it in runtime?

推荐答案

它是代码注释/IntelliSense 文件,由 IDE(即 Visual Studio)使用,而不是运行时 - 它是所有扩展方法/参数/类型描述等来自.

It is the code comments / IntelliSense file, and is used by the IDE (i.e. Visual Studio), not the runtime - it is where all the extended method / parameter / type descriptions etc come from.

你不需要用你的二进制文件来部署它,但它也没有坏处.它在 IDE 中也是完全可选的 - 只是:如果没有它,IntelliSense 对您的信息量会减少(它只会显示名称和类型等 - 而不是更详细的方法描述).

You do not need to deploy it with your binary, but it does no harm either. It is also entirely optional in the IDE - just: IntelliSense will be less informative to you without it (it will just display the names and types, etc - not the more verbose method descriptions).

在您自己的库中,使用///语法编写您自己的代码注释,并在项目属性中启用 XML 文件生成.

In your own library, use the /// syntax to write your own code comments, and enable the XML file generation in project-properties.

这篇关于与 .NET 程序集文件一起出现的 XML 文件是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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