Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
i add namespace which created by me in my program .

like that:

using mynamespace;

but it giving error

"Error 1 The type or namespace name 'ConsoleApplication2' could not be found (are you missing a using directive or an assembly reference?) "

please explain " using directive " and "assembly reference"

and solve problem with detail example
Posted
Comments
Maciej Los 11-May-14 8:02am    
Show the piece of your code.

The "using directive" is your using mynamespace; piece of code. An "assembly reference" is a reference to an assembly[^].

In this case, you are probably missing an assembly reference. If your ConsoleApplication2 is in another project (but in the same solution), then:

  1. Go to the Solution Explorer.
  2. Right-click on "References" and choose "Add Reference".
  3. In Visual Studio 2012/2013, choose "Solution", in VS 2010, choose "Projects".
  4. Select the project that contains your ConsoleApplication2 namespace and click OK.

If the ConsoleApplication2 project is not in the same solution, then chooose "Browse" instead of "Solution" and choose the desired assembly from your file system.
 
Share this answer
 
v2
Comments
Maciej Los 11-May-14 9:33am    
Please, notify me if your answer will be accepted as a solution. I'll give a 5!
Thomas Daniels 11-May-14 9:37am    
Ok, I'll do that!
Thomas Daniels 12-May-14 11:39am    
My answer is accepted now :)
Maciej Los 12-May-14 11:44am    
Great! My promised 5!
Thomas Daniels 12-May-14 11:46am    
Thank you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900