Solved

Problem with split namespace

Posted on 2006-06-21
7
553 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
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 basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

623 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