Solved

Problem with split namespace

Posted on 2006-06-21
7
536 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now