467,145 Members | 1,120 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

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
  • viewed: 1041
Share:
2 Replies
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Marcin Kalicinski | last post: by
7 posts views Thread by Kevin Newman | last post: by
5 posts views Thread by Alexis | last post: by
5 posts views Thread by Mike Oliszewski | last post: by
10 posts views Thread by anders | last post: by
4 posts views Thread by Kevin Newman | last post: by
30 posts views Thread by Pep | last post: by
7 posts views Thread by Armin Zingler | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.