473,322 Members | 1,610 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,322 software developers and data experts.

Namespace Problem

Hello, I have a solution which is comprised of 4 projects. One of the
project is "used" by the other 3. In each of those 3 project, I created
a reference to the project it was going to be using and I placed a
"using" statement for the namespace in each of the three projects. All
was fine with the world. I compiled and was able to use the solution
just fine.

Then I began to perform some maintenance on the project and now when I
go to compile, each of my "using" statements which references the
project being used by that class now highlights.

This has happened to me once before and I tried all kinds of things to
"fix" it and it finally started working again, but I was never quite
sure why. Now it has happened again and I would like to know how to
properly handle this problem again an understand what is causing it.

I suspect that when there is some sort of compile error in the project
which is being used, that perhaps this causes this problem. Even though
I have corrected the problem with class, It still does not clear up the
problem.

When I create a reference to a project....do I point it to the "dll" of
the class which I am referencing or should I be pointing to something
else? I am actually pointing to the "dll" in the bin/debug folder.

Any Ideas as to what is going wrong?
Nov 15 '05 #1
2 1212
"CJ Silin" <cj******@nospam.com> wrote in message
news:Xn*****************************@207.46.248.16 ...

When I create a reference to a project....do I point it to the "dll" of
the class which I am referencing or should I be pointing to something
else? I am actually pointing to the "dll" in the bin/debug folder.

Any Ideas as to what is going wrong?


Hi CJ,

You are using a file reference, which sounds like it is the root of your
problems. Instead, use a project reference by selecting Add Reference from
the project context menu, select the Projects tab of the Add Reference
dialog, select the library you want and click OK. This way, every time you
recompile the referencing project, it will ensure that the most recent
version of the library is available in its local directory.

I used to have all kinds of problems with this stuff until I read this:

Team Development with Visual Studio .NET and Visual SourceSafe
http://msdn.microsoft.com/library/de...ml/tdlg_rm.asp

Joe
--
http://www.csharp-station.com
Nov 15 '05 #2
Hi,

Moreover, when you use file reference and point to a dll, when you compile
the Release version of the referncing project, you get the debug version of
the dll of the referenced project.

It means that if you point a dll reference you always get the same version
of the referenced dll for both Debug and Release and it does not get
automatically recompiled.

In this way, you:
- either are distributing and compiling with the debug version of the
referenced project (if you point to Debug dll)
- or are unable do debug the referenced project with the referencing project
(if you point to Release dll)

It's a good idea to reference to Release dlls if you have a closed, stable
project and have many projects in the solution and adding another one
becomes unhandy and makes the comile times longer.

Cezary Nolewajka
mailto:c.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply

"Joe Mayo [MVP C#]" <jm***@nospamAtCSharpDashStation.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...
"CJ Silin" <cj******@nospam.com> wrote in message
news:Xn*****************************@207.46.248.16 ...

When I create a reference to a project....do I point it to the "dll" of
the class which I am referencing or should I be pointing to something
else? I am actually pointing to the "dll" in the bin/debug folder.

Any Ideas as to what is going wrong?
Hi CJ,

You are using a file reference, which sounds like it is the root of your
problems. Instead, use a project reference by selecting Add Reference

from the project context menu, select the Projects tab of the Add Reference
dialog, select the library you want and click OK. This way, every time you recompile the referencing project, it will ensure that the most recent
version of the library is available in its local directory.

I used to have all kinds of problems with this stuff until I read this:

Team Development with Visual Studio .NET and Visual SourceSafe
http://msdn.microsoft.com/library/de...ml/tdlg_rm.asp
Joe
--
http://www.csharp-station.com

Nov 15 '05 #3

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

Similar topics

8
by: Marcin Kalicinski | last post by:
Is the code below ill formed (because operator >> is defined in different namespace than class B)? It fails with VS 2005 Beta. I don't know if I should redesign my code or if I should find a...
7
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; ...
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...
0
by: richwangler | last post by:
This problem should be easily reproducable if anybody has the time. I need to build the following XML programatically and decided to use the XMLSerializer. I simplified the XML (myExample.xml)...
5
by: Mike Oliszewski | last post by:
Given the following c# code: namespace Company2 { public class SomeFunctions { public void FunctionA() { // Do Something. }
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...
4
by: Kevin Newman | last post by:
The primary problem I've had with php is the lack of namespaces, which makes OOP very difficult to organize, since you end up with large number of classes cluttering up the same namespace - which...
30
by: Pep | last post by:
Is it best to include the code "using namespace std;" in the source or should each keyword in the std namespace be qualified by the namespace tag, such as std::cout << "using std namespace" <<...
3
by: George | last post by:
I am currently developing an xbrl validation software that takes an xml instance file and a lot of schemas(xsd files) and validates it against the xsd files. I am using Visual basic in visual...
7
by: Armin Zingler | last post by:
Hi all, I have a Form called "Main": Public Class Main Private Sub Button1_Click( _ ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.