F
Francois Malgreve
Hello everybody,
I have a pretty straightforward question regarding namespace.
Is there anyone who knows why the following code does not compile on the
line Type t = typeof(Name6.Name7.Name6.Class6) ? I am using Visual Studio
2006 by the way (.Net 2.0)
As far as I know "Name6.Name7.Name6" is a valid namespace but, somehow, some
operations on that namespace will not compile. From the example, we can
clearly see that it is because "Name6" is twice in the namespace.
namespace Name2
{
public class Class1
{
Type t = typeof(Name2.Class1);
}
}
namespace Name3
{
public class Class2
{
Type t = typeof(Name3.Class2);
}
}
namespace Name4.Name5
{
public class Class4
{
Type t = typeof(Name4.Name5.Class4);
}
}
namespace Name6.Name7.Name6
{
public class Class6
{
Type t = typeof(Name6.Name7.Name6.Class6); // Does not compile! Why?
}
}
namespace Name8.Name9.Name89
{
public class Class7
{
Type t = typeof(Name8.Name9.Name89.Class7);
}
}
Best regards,
Francois Malgreve
http://www.malgreve.net
I have a pretty straightforward question regarding namespace.
Is there anyone who knows why the following code does not compile on the
line Type t = typeof(Name6.Name7.Name6.Class6) ? I am using Visual Studio
2006 by the way (.Net 2.0)
As far as I know "Name6.Name7.Name6" is a valid namespace but, somehow, some
operations on that namespace will not compile. From the example, we can
clearly see that it is because "Name6" is twice in the namespace.
namespace Name2
{
public class Class1
{
Type t = typeof(Name2.Class1);
}
}
namespace Name3
{
public class Class2
{
Type t = typeof(Name3.Class2);
}
}
namespace Name4.Name5
{
public class Class4
{
Type t = typeof(Name4.Name5.Class4);
}
}
namespace Name6.Name7.Name6
{
public class Class6
{
Type t = typeof(Name6.Name7.Name6.Class6); // Does not compile! Why?
}
}
namespace Name8.Name9.Name89
{
public class Class7
{
Type t = typeof(Name8.Name9.Name89.Class7);
}
}
Best regards,
Francois Malgreve
http://www.malgreve.net