All rules
IDE0130Language rules (expression-level preferences)
Namespace does not match folder structure
Namespace does not match folder structure
Microsoft docsDescription
This style rule uses the folder structure of the project to enforce namespace naming requirements.
Example
// Code with violations
namespace Root.BadExample
{
class Example
{
public void M()
{
}
}
}
// Fixed code
namespace Root.Data
{
class Example
{
public void M()
{
}
}
}Configurable options
Vote for the value each option should take in the generated .editorconfig.
dotnet_style_namespace_match_folder default:
trueYour vote
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0