Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with split namespace

Posted on 2006-06-21
7
Medium Priority
?
562 Views
Last Modified: 2013-11-19
Visual Studio 2005

I have a web site that has a number of namespaces organized around different applications in their own folders.  One of the namespaces seems to have been split, and I'm not sure what to do to fix it.

In the object browser, one of them says:
Namespace Admin
     Member of: http://localhost/websitename/

The other reads:
Namespace Admin
     Member of: App_Web_gdppjhsq

classes of one namespace do not recognize classes in the other.  In my source I get "type not defined errors"  and it will refuse to build until I remove the variable declaration.

I thought this might be a problem with the temporary ASP.NET files, so I closed down visual studio, rebooted, deleted all the files in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and used iisreset.  Absolutely no difference.

Any ideas?

0
Comment
Question by:PaulHews
  • 5
  • 2
7 Comments
 
LVL 7

Accepted Solution

by:
kGenius earned 1500 total points
ID: 16954498
Did you add references to these different applications where you need them in an application
0
 
LVL 38

Author Comment

by:PaulHews
ID: 16954660
They are all in the same website... Most of them were developed separately and folded in by hand, but now they should be one big happy family.  In fact previously to my recently adding a new user control to the Admin namespace, the system worked fine.  The namespaces are really there to prevent collisions between similarly named classes in different folders.  

There isn't any cross communication between the previous applications.  The shared code is managed in two DLL libraries.
0
 
LVL 38

Author Comment

by:PaulHews
ID: 16961927
It seems like only the new usercontrol is causing the problem.  I've tried taking that usercontrol out of the namespace, but it still can't see items in the admin namespace, and they can't see it.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 38

Author Comment

by:PaulHews
ID: 16962115
I'm also getting this message when I make changes to the usercontrol, unless I rebuild the entire solution:

Unable to cast object of type 'ASP.admin_grpcatoverview_ascx' to type 'grpCatOverview'.  grpCatOverview is the problematic usercontrol, which I am loading dynamically.  Is this related?
0
 
LVL 38

Author Comment

by:PaulHews
ID: 16962141
So far the only possible workaround I've found is to use late binding instead of defining those class types.
0
 
LVL 38

Author Comment

by:PaulHews
ID: 16962479
Argh!  It's been so long since I did the previous controls, that I forgot I needed to add the reference control statement at the top of the markup:

<%@ Reference Control="~/Admin/grpCatOverview.ascx"%>

Once that's added, the type is accessible in the code behind... So you were right, it was a reference problem.
0
 
LVL 7

Expert Comment

by:kGenius
ID: 16962708
yeehaa :-)
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question