我有一个如下所示的类:
Public Class Utilities
Public Shared Function blah(userCode As String) As String
'doing some stuff
End Function
End Class
我在上面运行 FxCop 10,它说:
"Because type 'Utilities' contains only 'static' (
'Shared' in Visual Basic) members, add a default private
constructor to prevent the compiler from adding a default
public constructor."
好的,FxCop 先生,你是对的,我将添加一个私有构造函数:
Private Utilities()
现在我有:
"It appears that field 'Utilities.Utilities' is
never used or is only ever assigned to. Use this field
or remove it."
关于我应该怎么做才能摆脱这两个警告的任何想法?