如何增加在C#中的多行注释时,禁止在Visual Studio中的自动星号? [英] How to disable the automatic asterisk in Visual Studio when adding a multi-line comment in C#?
问题描述
可能重复:结果
的我如何从一个注释块中自动插入星号停止的Visual Studio?
当添加在Visual Studio中多行注释,它会自动将在新行的开头星号(*)(上输入)注释块内。我个人觉得这是一个滋扰。有谁知道如何禁用它?谢谢你。
在网上找到这个答案对你(看到的这里):
这适用于Visual Studio 2005和2008:
在IDE中,进入工具 - >导入和导出设置;然后导出选定的环境设置;取消选择除选项 - >文本编辑器的一切;保存到一个新的文件。
编辑您的出口设置一些文本编辑器文件。搜索字符串AutoComment。有值为1为PropertyValue标签,将其更改为0,并保存文件。
在IDE中,导入使用工具 - >导入和这个新的文件导出设置。它应该停止格式化意见的时候了。
块引用>
要清楚,我还没' ŧ测试它自己呢。 。 。 。请让我们知道,如果你的作品
更新:
另一个这样,如张贴在前面的问题在这个
工具>选项...>文本编辑器> C#>高级>取消勾选(由罗布面包车Groenewoud,上面链接)生成///\".
(当然,除了摆脱自动*块注释,这将禁用自动套用格式,当你键入///,因为它说。)
这听起来像我上面给做同样的事情,但通过编辑设置文件本身,而不是使用该解决方案菜单选项。
Possible Duplicate:
How do I stop visual studio from automatically inserting asterisk during a block comment?When adding a multi-line comment in Visual Studio, it automatically places an asterisk (*) at the beginning of a new line (on enter) inside the comment block. I personally find this a nuisance. Does anyone know how to disable it? Thanks.
解决方案Found this answer for you online (see here):
This works with Visual Studio 2005 and 2008:
in the IDE, go to Tools->Import and Export Settings; then Export selected environment settings; deselect everything except Options->Text Editor; save to a new file.
Edit your exported settings file in some text editor. Search for the string "AutoComment". There's a PropertyValue tag with value 1, change it to 0, and save the file.
in the IDE, import this new file using Tools->Import and Export Settings. It should stop formatting comments right away.
To be clear, I haven't tested it myself yet . . . please let us know if it works for you.
Update:
Another way, as posted in the previous question on this (linked by Rob van Groenewoud, above)
Tools > Options... > Text Editor > C# > Advanced > Uncheck "Generate XML Documentation comments for ///".
(Of course, in addition to getting rid of the automatic * in block comments, this will disable the autoformatting when you type "///", as it says.)
It sounds like the solution I gave above does the same thing, but by editing the settings file itself instead of using the menu options.
这篇关于如何增加在C#中的多行注释时,禁止在Visual Studio中的自动星号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!