Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why one project (exe) does not see the namespace of another project (dll) in the same solution?

Tags:

c#

Why one project (exe) does not see the namespace of another project (dll) in the same solution?

like image 771
SkyN Avatar asked Mar 24 '10 14:03

SkyN


2 Answers

You need to add a reference from the using project to the DLL first.

Select Project|Add Reference, Projects Tab.

like image 118
Henk Holterman Avatar answered Sep 18 '22 10:09

Henk Holterman


A "solution" in Visual Studio is a collection of projects. Each project is independent of all the others. The solution is just a convenient way of organizing projects and opening them all together.

If one project is going to use the public objects defined in another project, then it must be compiled with a reference to the other project. This is true whether the projects are part of a single solution or not.

To signal to Visual Studio that the EXE must be compiled with a reference to the DLL, you must add the DLL to the EXE's list of references in the Solution Explorer.

like image 38
Jeffrey L Whitledge Avatar answered Sep 19 '22 10:09

Jeffrey L Whitledge