How do I use a C# Class Library in a project?

后端 未结 9 2013
北恋
北恋 2020-11-28 05:23

I\'ve created a new Class Library in C# and want to use it in one of my other C# projects - how do I do this?

9条回答
  •  醉梦人生
    2020-11-28 05:49

    Right Click on Project--> Add--> New Project-->click on Class Library.

    Now your class library is created as class1.cs

    Right Click on References(of your program/console app)

    -->Add Reference-->classLibrary1(whatever you named) Now mention "using ClassLibrary1" in your program/console app

    Now u can easily call the method/property in your console app

提交回复
热议问题