This website may use cookies. More info. That's Fine x
Welcome Login

Visual studio: Creating a class library project

Visual Studio 2010


1. Start a new project, choose class library.





2. The class libary project name is used for the namespace name.

3. Add class: Right click on class library project > Add > New Item... > Visual C# Items > Code > Class



4. Note: if you add a class in a folder, Namespace will be [Namespace].[folder].  Just delete the folder name in the namespace if you want to simplify class library namespace name.

5. To use a class library within a project, add the class libary reference to the project.



6. To access properties/methods of a class library, make sure the access modifier is 'public' for the class




Note: You can check that your project is a class library in properties:


Created on: Tuesday, September 6, 2011 by Andrew Sin