אירוע
בניית אפליקציות וסוכנים של בינה מלאכותית
17 במרץ, 21 - 21 במרץ, 10
הצטרף לסידרה של פגישות כדי לבנות פתרונות מדרגיים של בינה מלאכותית בהתבסס על מקרי שימוש מהעולם האמיתי עם מפתחים ומומחים אחרים.
הירשם עכשיוהדפדפן הזה אינו נתמך עוד.
שדרג ל- Microsoft Edge כדי לנצל את התכונות, עדכוני האבטחה והתמיכה הטכנית העדכניים ביותר.
Property | Value |
---|---|
Rule ID | CA1707 |
Title | Identifiers should not contain underscores |
Category | Naming |
Fix is breaking or non-breaking | Breaking - when raised on assemblies Non-breaking - when raised on type parameters |
Enabled by default in .NET 9 | No |
The name of an identifier contains the underscore (_) character.
By convention, identifier names do not contain the underscore (_) character. The rule checks namespaces, types, members, and parameters.
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve that is required for new software libraries, and increases customer confidence that the library was developed by someone who has expertise in developing managed code.
Remove all underscore characters from the name.
Do not suppress warnings for production code. However, it's safe to suppress this warning for test code.
If you just want to suppress a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.
#pragma warning disable CA1707
// The code that's violating the rule is on this line.
#pragma warning restore CA1707
To disable the rule for a file, folder, or project, set its severity to none
in the configuration file.
[*.{cs,vb}]
dotnet_diagnostic.CA1707.severity = none
For more information, see How to suppress code analysis warnings.
For well-known methods in Microsoft code that currently use an underscore and cannot be modified, the rule should be suppressed.
Use the following option to configure which parts of your codebase to run this rule on.
You can configure this option for just this rule, for all rules it applies to, or for all rules in this category (Naming) that it applies to. For more information, see Code quality rule configuration options.
You can configure which parts of your codebase to run this rule on, based on their accessibility, by setting the api_surface option. For example, to specify that the rule should run only against the non-public API surface, add the following key-value pair to an .editorconfig file in your project:
dotnet_code_quality.CAXXXX.api_surface = private, internal
הערה
Replace the XXXX
part of CAXXXX
with the ID of the applicable rule.
משוב של .NET
.NET הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב:
אירוע
בניית אפליקציות וסוכנים של בינה מלאכותית
17 במרץ, 21 - 21 במרץ, 10
הצטרף לסידרה של פגישות כדי לבנות פתרונות מדרגיים של בינה מלאכותית בהתבסס על מקרי שימוש מהעולם האמיתי עם מפתחים ומומחים אחרים.
הירשם עכשיו