c# - 是否有命名空间的所有保留关键字的列表?

标签 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# 中命名空间的保留关键字的完整列表?

最佳答案

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

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

关于c# - 是否有命名空间的所有保留关键字的列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59085307/

相关文章:

c# - Visual Studio : Code analyzer to determine what exceptions a method can throw?

c# - CosmosDb 按 slug 获取项目

c# - 打开文件时,Excel 导入数据集会中断

c# - 如何在 asp.net 身份中使用指定的盐和密码生成哈希?

c# - 使用依赖注入(inject) C# 处理 null 的最佳实践

c# - 从文件名中删除非法字符以刻录到 CD 上

c# editorconfig CA1062 具有可为空引用类型的空检查验证方法(用于保护子句)

c# - 代码分析 - 不要多次处理对象

c# - 代码分析规则 CA1040 : Avoid empty interfaces, 在非空接口(interface)上报错

c# - .ToString() 和 .ToString(CultureInfo.CurrentCulture)