Reputation: 7331
i have c# library project. i add it(library.sln)
as a existing project to my project. so it comes to my solution explorer.
but in my forms when i try to access it, it seems it dose not exist using library;
is noting !
where am i wrong, and what i need to do ?
it can not be build itself in visual studio when i try to debug project, the error is :
a project with an output type of class library can not be started directly
you can see the library project here http://www.codeproject.com/KB/selection/FarsiLibrary.aspx?msg=4043318#xx4043318xx
and it have 4 namespace.
Upvotes: 0
Views: 1663
Reputation: 1840
There are already good answers, but I would also suggest creating a Test project as a more efficient way of debugging the library.
Upvotes: 0
Reputation: 6292
You need to use the "Set as StartUp Project" option in your context menu to set a runnable project. The project "library" you created is probably a class library which is not runnable.
Create some runnable project e.g. Condole application to use your library and set that as startup project. Then run your project.
Upvotes: 2
Reputation: 273591
Upvotes: 2
Reputation: 10347
Even if you add the project to your solution, you have to add a reference to that project for the WinForms project. This has nothing to do with the library.
If your WinForms uses .NET 4 Client Profile and the library requires .NET Full, then you can't access it and need to change the WinForms project to use the full .NET 4 runtime.
Upvotes: 0
Reputation: 1775
Rightclick on your references folder, press "add reference", switch to "projects" and add the reference to your library project.
Upvotes: 0
Reputation: 342
A library is just a collection of classes, interfaces, enums etc.. In order to debug it, you'll probably want to create a console application that calls methods on your classes that you want to debug.
In addition, just adding the library to the solution is not enough for other libraries to be able to see them. In order to do this, you have to add it as a reference. You can do this by right clicking on the References item in your project, then Add Reference.
Upvotes: 0