gpt4 book ai didi

c# - 编译器警告 CS1591 : How to show that warning only for undocumented methods?

转载 作者:可可西里 更新时间:2023-11-01 03:06:12 25 4
gpt4 key购买 nike

如果公共(public)成员未记录,C# 编译器会显示警告 ( CS1591):

Warning ... Missing XML comment for publicly visible type or member ...

这包括所有属性、方法、类、枚举值等。

问题:有没有一种方法可以将这种类型的警告配置为只标记未记录的方法?我使用 Visual Studio 2010 Ultimate 和 ReSharper 8.2。

示例:

public class MyClass // warning
{
public MyClass(int x) { ... } // warning

public void DoSomething() { ... } // warning

public int MyProp { get; private set; } // prevent this warning
}

public enum MyEnum // warning
{
X = 0, // prevent this warning
Y = 1 // prevent this warning
}

最佳答案

如果您愿意,可以为整个程序集禁用它。

Project Properties > Build tab > Suppress warnings: 1591

来源:https://stackoverflow.com/a/13414522

关于c# - 编译器警告 CS1591 : How to show that warning only for undocumented methods?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25846205/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com