CA1050: Declare types in namespaces
Visual Studio 2012
|
TypeName |
DeclareTypesInNamespaces |
|
CheckId |
CA1050 |
|
Category |
Microsoft.Design |
|
Breaking Change |
Breaking |
The following example shows a library that has a type incorrectly declared outside a namespace, and a type that has the same name declared in a namespace.
The following application uses the library that was defined previously. Note that the type that is declared outside a namespace is created when the name Test is not qualified by a namespace. Note also that to access the Test type in Goodspace, the namespace name is required.