Type or namespace name not found

R

Rookie

I have two C# VS .Net 2003 projects that compile and
execute correctly on their own.

I would like the second project to launch from within the
first project. Therefore, I added the second project to
the first, via "add project/existing", and added a button
(and code) to launch the second project (from the first).

I receive the error: "The type or namespace name could
not be found (are you missing a using directive or an
assembly reference?)" and do not understand this error.
I am assuming that the second project contents have to be
made known to the first project, but I am unsure how to
do this.
Can anyone help?
Thanks.
 
R

Rami Saad

Hello,
You might just need to add the Namespace when calling from the 2nd
project.....
 
J

Jon Skeet [C# MVP]

Rookie said:
I have two C# VS .Net 2003 projects that compile and
execute correctly on their own.

Ah - that could actually cause a problem. (See later.)
I would like the second project to launch from within the
first project. Therefore, I added the second project to
the first, via "add project/existing", and added a button
(and code) to launch the second project (from the first).

I receive the error: "The type or namespace name could
not be found (are you missing a using directive or an
assembly reference?)" and do not understand this error.
I am assuming that the second project contents have to be
made known to the first project, but I am unsure how to
do this.
Can anyone help?

Yes - as the error message suggested, you need to add a reference.
Right click on the project and select "Add reference". Select the
"Projects" tab and select the project you want to add a reference to.

However, under VS.NET you can't add a reference to another executable
assembly - only to a class library.
 
R

Rookie

Thanks Rami. Syntactically, where do you do this?
(I tried this earlier but must have placed the namespace
in the wrong location). Project 1 and 2 have different
namespaces (as expected) and when I tried to place
Project 2 namespace in Project 1, I receive numerous
errors.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top