VS2010 C # How to make a class DLL and use this class from another project 2011-10-20 486 people read reviews (0) favorite reports
First, the class is made into a DLL
Method One: You can make the Xxx.cs file directly into a DLL file by using a command at the command line
Method two: Through Visual studio2010
Create a new project, select "Class Library", and here you can write the user's own class.
Second, reference DLL
In the project, open Solution Explorer, right-click Reference and Add Reference and browse and locate the DLL from the host's directory
The class in the DLL can then be used in your project class file using the use {DLL's namespace}.
Note: Classes in a class library must not be declared private (no adornment Fuzeme is considered private), or the class cannot be used even if the DLL is introduced into the project. If there is only one class in this DLL, and the class is private, the namespace of the DLL that contains the class cannot be referenced.
VS2010 C # How to make a class into a DLL and use this class from another project