473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with namespace

Hi I have a ASP.NET Solution with two projects.

Project 2 has a reference to Project1

Project 1 contains a folder with path 'ctrlContacts\Address\. Under
this path is a Class called AddressView with namespace
ctrlContacts.Address. This class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace ctrlContacts.Address {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(ctrlContacts.Address.Designers.Add ressViewDesigner)),
ToolboxData("<{0}:AddressView runat=server></{0}:AddressView>")]
public class AddressView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();
Project 2 that uses this Class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using gg.electricity.WebControls;
using gg.electricity.StandardSharedLibrary;

namespace controls.servicecable {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(controls.servicecable.Designers.Se rviceCableViewDesigner)),
ToolboxData("<{0}:ServiceCableView
runat=server></{0}:ServiceCableView>")]
public class ServiceCableView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();
private ControlViewStyle _CSSAddressStyle = new
ControlViewStyle();
private DataSummaryStyle _CSSServiceCableDetailsSummaryStyle = new
DataSummaryStyle();

// controls for displaying the address
private Label lblServiceNumber;
private ctrlContacts.Address.AddressView _Address;
The last line is the line that references Project 2 and has an error:
C:\Inetpub\wwwroot\dotNet\Applications\ServicesAnd Meters\controls\servicecable\ServiceCableView.cs(2 4):
The type or namespace name 'ctrlContacts' could not be found (are you
missing a using directive or an assembly reference?)

Even if I right click on AddressView of this line and look at the
Declaration it does take me to the correct function. Why then does .Net
say it can't find it????

Your help would be much appreciated.

Thanks,

John Guilbert.

Jan 10 '06 #1
1 1310
Have you added project1 assembly or object file to project2?

MattC

"John Boy" <jo***********@lionbridge.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi I have a ASP.NET Solution with two projects.

Project 2 has a reference to Project1

Project 1 contains a folder with path 'ctrlContacts\Address\. Under
this path is a Class called AddressView with namespace
ctrlContacts.Address. This class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace ctrlContacts.Address {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(ctrlContacts.Address.Designers.Add ressViewDesigner)),
ToolboxData("<{0}:AddressView runat=server></{0}:AddressView>")]
public class AddressView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();
Project 2 that uses this Class starts as follows:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using gg.electricity.WebControls;
using gg.electricity.StandardSharedLibrary;

namespace controls.servicecable {

/// <summary>
/// Creates controls for viewing an address object
/// </summary>
[Designer(typeof(controls.servicecable.Designers.Se rviceCableViewDesigner)),
ToolboxData("<{0}:ServiceCableView
runat=server></{0}:ServiceCableView>")]
public class ServiceCableView : System.Web.UI.WebControls.WebControl,
INamingContainer {

// class applied to each label
private ControlViewStyle _CSSStyle = new ControlViewStyle();
private ControlViewStyle _CSSAddressStyle = new
ControlViewStyle();
private DataSummaryStyle _CSSServiceCableDetailsSummaryStyle = new
DataSummaryStyle();

// controls for displaying the address
private Label lblServiceNumber;
private ctrlContacts.Address.AddressView _Address;
The last line is the line that references Project 2 and has an error:
C:\Inetpub\wwwroot\dotNet\Applications\ServicesAnd Meters\controls\servicecable\ServiceCableView.cs(2 4):
The type or namespace name 'ctrlContacts' could not be found (are you
missing a using directive or an assembly reference?)

Even if I right click on AddressView of this line and look at the
Declaration it does take me to the correct function. Why then does .Net
say it can't find it????

Your help would be much appreciated.

Thanks,

John Guilbert.

Jan 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sandy | last post by:
Hi, I have two files as folllows file1.cpp #include<iostream> using namespace std; namespace { void show(); void fun() { cout<<"fun called\n"; } }
5
by: Alexis | last post by:
Hello, I have a set of classes I created from schema files using the xsd.exe tool. I'm using namespaces in the clases ( I had to because I have some classes with the same name but not the same...
9
by: Richard L Rosenheim | last post by:
I'm trying to query a XML file that was created via ADO.NET. My query wasn't returning anything, and I tracked the problem to an issue with the namespace that ADO.NET specified. When I remove the...
3
by: Steven Fox | last post by:
============================================================ About DB2 Administration Tools Environment ============================================================ DB2 administration tools level:...
10
by: anders | last post by:
I have 2 external assemblies A1 and A2 that both define class X in the global namespace. I need to use both assemblies in my VB project but the names X are ambiguous. How can I get around this...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
1
by: Alex Maghen | last post by:
I've been using my installed VS 2005 for several months with no problem. Suddenly, something strange is happeneing and I'm not sure if it's something I'm missing in ASP.NET or something that's...
0
by: Sergio E. | last post by:
Hello, I have a problem with masterpages and forms security. I made a new Web site, in which I have my page of login like of beginning, a master page with only a sitemappath object in it, the...
0
by: Sergio E. | last post by:
Hello, I have a problem with masterpages and forms security. I made a new Web site, in which I have my page login.aspx as the homepage , a master page with only a sitemappath object in it, the...
6
by: praveenb000 | last post by:
we hosted a website http://vijayawadanalanda.org developed using asp.net and back end MS Accees database. There is some database connectivity problem occurring when saving the information in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.