Solved

Problem with split namespace

Posted on 2006-06-21
7
540 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 500 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 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