是否有名称空间的所有保留关键字的列表?

时间:2019-11-28 09:17:21

标签: c# code-analysis

在解决方案上运行代码分析 ([Roslyn] Microsoft.CodeAnalysis.FxCopAnalyzers) 时,出现以下警告:

Warning CA1716 

Rename namespace CompanyA.Product.Shared.LibraryA so that it no longer conflicts
with the reserved language keyword 'Shared'. 
Using a reserved keyword as the name of a namespace makes it harder for consumers 
in other languages to use the namespace.

在哪里可以找到C#中命名空间的保留关键字的完整列表?

2 个答案:

答案 0 :(得分:4)

整个列表太长,无法在此处重复,在以下变量中用IdentifiersShouldNotMatchKeywords.cs进行了硬编码:

它包含来自C#,VB.NET和C ++的保留关键字。

答案 1 :(得分:0)

这是VB.Net项目吗?由于Shared是一个 VB.Net reserved keyword