I am a C# developer, but am trying to convert code over to VB so that other developers can reuse it in their projects. I created a project, "Oh", which is an ASP.NET project. Now, I want to set the namespaces to all of the pages to something specifically so
that I can ensure they are logically where expected, which is fine in C# - we'll call this namespace, "SpankMe.Daddy". Well, when I compile the project, everything works beautifully. When I execute it, I get an error: Could not load type 'Oh.SpankMe.Daddy._Default'.
Well, I explicitly specified the namespace as "SpankMe.Daddy", so why is it placing it in the Oh namespace, too!?!? That makes no sense at all. Is there any way around this flaw? Any help is appreciated. Thanks in advance.
I stated this wrong. When I go to the page, the error is: Could not load type 'SpankMe.Daddy._Default'. The problem is that Visual Studio seems to tack on the namespace I specify to the project's default namespace, which makes it, Oh.SpankMe.Daddy._Default.
I don't want to do that because the pages are intended to be a "starter kit" where other developers can modify them as needed and even suggest improvements and so on.
You need to remove the root namespace from the project file. This is a quirky VB thing to hide "complexity" of namespaces, but its a huge pain in any real team development if used as is.
Thanks, Paul Wilson, ASPInsider, MC**
For the best .NET code, examples, and tools, visit:
WilsonDotNet.com, WilsonWebPortal.com, ORMapper.net
That will work for my project, but what about the people that use the starter kit? Maybe it's just my opinion, but I wouldn't want to use something that mandated my default namespace to be blank...Wait, is that even possible? That seems wierd that the compiler
would allow code that is not in a namespace. At this point, however, I would not doubt it. I will have to accept this as the way ahead until I find a better way to do this. Honestly, this whole conversion activity has solidified my reasons for using C#. If
anyone finds a better way to handle this situation, please let me know. Thanks.
ciddivine
Member
70 Points
14 Posts
VS/VB/Namespaces
Sep 04, 2003 05:32 PM|LINK
JimmyM
Star
8796 Points
1671 Posts
Re: VS/VB/Namespaces
Sep 04, 2003 05:40 PM|LINK
ciddivine
Member
70 Points
14 Posts
Re: VS/VB/Namespaces
Sep 04, 2003 05:48 PM|LINK
ciddivine
Member
70 Points
14 Posts
Re: VS/VB/Namespaces
Sep 04, 2003 05:49 PM|LINK
PaulWilson
Contributor
3715 Points
745 Posts
ASPInsiders
Re: VS/VB/Namespaces
Sep 04, 2003 11:00 PM|LINK
For the best .NET code, examples, and tools, visit:
WilsonDotNet.com, WilsonWebPortal.com, ORMapper.net
ciddivine
Member
70 Points
14 Posts
Re: VS/VB/Namespaces
Sep 05, 2003 01:10 AM|LINK