Adding existing project in c#
I have add the existing project in my new project, but when I try to use the existing library, I see the following error:
t开发者_如何学Che type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)
What would cause this?
you must add in your main project reference to other project
(project's property -> add reference -> projects -> select your second project )
or you must add
using com;
If you have already added the reference to the project then try adding a using
for the added class in the .cs file where you want to use it:
using com;
Right click the name of the project you want to add the library to > Select Add Reference, in the dialog box, > select Projects. > Select and ADD the library.
Reference the library in the ‘using’ section of any class you wish to access the library.
using System;
using <nameofproject>
Also read this article.
http://www.csharphelp.com/2006/02/namespaces-in-c/
精彩评论