Compiler error occurs when you duplicate namespace names (316734)
The information in this article applies to:
- Microsoft Visual Basic 2005 Express Edition
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
This article was previously published under Q316734 SYMPTOMS
When you compile your project, you may receive a compiler error that states that a method or a property does not exist in a specific namespace.
You may notice that the namespace that the error refers to is a namespace that you created, not the common language runtime namespace that you intended to use.
CAUSE
This behavior occurs when you name a custom namespace by using the same name as one of the common language runtime namespaces.
RESOLUTION
When you choose names for the custom namespaces in your project, make sure that you do not duplicate namespaces that already exist in the common language runtime or in other referenced assemblies. If you duplicate namespace names, code in your namespace resolves to your custom namespace and not to the namespace in the common language runtime.
If you cannot rename your custom namespace, you can use an alias for that namespace. For more information about how to create an alias for your custom namespace, see the steps in the "More Information" section.
STATUSThis behavior is by design.
Modification Type: | Major | Last Reviewed: | 3/17/2006 |
---|
Keywords: | kbtshoot kbvs2005applies kbvs2005swept kbCompiler kbprb KB316734 |
---|
|