简体   繁体   English

是否可以在没有“生成XML文档文件”的情况下自动创建XML注释标记(仅限VB.NET)?

[英]Is it possible for Visual Studio 2008 Automatically create XML Comments tags without “Generate XML documentation file” checked (VB.NET only)?

When in VS 2008 if a developer hits the ''' it generates the XML comment tags for you, but this only works when the project setting for "Generate XML documentation file" is checked. 在VS 2008中,如果开发人员点击''',它会为您生成XML注释标记,但这仅在选中“生成XML文档文件”的项目设置时才有效。

Is there a way to tell VS to generate the XML Comment tags, regardless of the project setting? 有没有办法让VS生成XML Comment标签,无论项目设置如何?

I think it is possible that someone may want comments but not create a XML documentation file. 我认为有可能有人想要评论但不能创建XML文档文件。

In this case I am exceeding the current Team Settings, yet other developers don't want me to change this project setting. 在这种情况下,我超出了当前的团队设置,但其他开发人员不希望我更改此项目设置。 This forces me to flip this back before checking in the project. 这迫使我在检查项目之前将其翻转。

I have the same problem with other Project settings like "code Analysis". 我对“代码分析”等其他项目设置也有同样的问题。

This is only a problem for VB.NET projects. 这只是VB.NET项目的一个问题。

I know this is an old post however I have found a work around that may work for you depending if you team members just want the XML comments functionality and not the XML files. 我知道这是一篇旧帖子,但我找到了一个可能对你有用的工作,这取决于你的团队成员是否只想要XML注释功能而不是XML文件。

1) In your project properties ensure that Generate XML documention file is checked. 1)在项目属性中,确保选中“ Generate XML documention文件。
2) Click the Build Events button 2)单击“ Build Events按钮
3) Into the Post-build event command line box enter the command 3)进入Post-build event command line框,输入命令

Del "$(OutDir)$(ProjectName).xml"

Now after each build it will remove the XML comment file. 现在,在每次构建之后,它将删除XML注释文件。

Note: For some reason if it exists from a previous build it will not delete it so manually delete it the first time. 注意:由于某种原因,如果它存在于以前的版本中,它将不会删除它,因此第一次手动删除它。

As far as I know, it will always create the xml comments....the Generate XML documentation I think only affects whether those comments are then compiled into an xml file. 据我所知,它将始终创建xml注释....生成XML文档我认为只会影响这些注释是否编译成xml文件。

Is it behaving like this on everyone's machine? 在每个人的机器上都是这样的吗?

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=477562 http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=477562

but obviously you already know that since you opened up the Connect issue. 但显然你已经知道,因为你打开了Connect问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM