ahmed
ahmed

Reputation: 14666

in c# how to call a class from my other project?

I built a class using C# and now I want to be able to call this class from other projects without using web services!! is this possible? are we able reference class from other projects?!

Many Thanks

Upvotes: 0

Views: 188

Answers (2)

Nighil
Nighil

Reputation: 4127

you can create Class Library Projects(dll) for these purpose and can add the reference to the Project you want

Upvotes: 0

Paolo Tedesco
Paolo Tedesco

Reputation: 57272

If a class is public, then it can be used by other projects.

In your project, you must add a reference to the assembly (dll) containing the class that you want you use.

In Visual Studio, right click on the project and select "add reference". If you have two projects in the same solution, you can reference a project using the "Projects" tab in the "Add reference" dialog.

See msdn for more details: How to: Add or Remove References in Visual Studio

Upvotes: 2

Related Questions