Solved

Problem with split namespace

Posted on 2006-06-21
7
541 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
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 receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

828 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