VS2010 C # How to make a class into a DLL and use this class from another project

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.