I’m working on an ASP.NET web application with .NET 3.5 and have run into the following problem:
I’m working with a class under the namespace X.Web.Controls.Core which references the class Utils in the namespace X.X2.components.util.
I get an error that Utils is already defined in the namespace X.Web.Controls.Utils
This should not be possible since I can’t find anything referencing that namespace from the class I’m working on. Any ideas?
I can’t really see that there should be a problem unless you have a
usingstatement referencing it somewhere. Do take care that code in a namespace will implicitly “see” classes in the same namespace, even if they’re defined elsewhere.Anyways, you can solve your problem by changing the class name (for the current code file only):
The class will be named
X2Utilsin your code. Alternatively you can make a shortcut for its namespace:Now you can refer to the class using
X2util.Utils.