Compiling a CS file to build a DLL file to compile the class into an assembly

Source: Internet
Author: User

1. Csc.exe is. NET used to compile the. cs file. Generally in C:\Windows\Microsoft.NET\Framework\v2.0.50727

2, first confirm whether to configure the environment variables (of course, if you do not configure the line, but to add a path), if not, follow these steps to configure (WINDOW7)

Right-click on "Computer"--"properties"--"Advanced system Settings"--"Environment variables"-"System variables" to find the variable path
Add paths to Path: c:/windows/microsoft.net/framework/v2.0.50727/.

3. Start-run-type cmd,window7 The default is C:\Users\zuo (username) >.

4, Input: cd\. That is, the C-drive directory. (Of course the next step input D: on the D-plate)

5. Enter: csc-? or csc-help to view the command options. (However, there is no egg, because a lot of it is not used and can not understand)

6. Copy the CS file you want to compile to the C packing directory

7, in DOS input: Csc/t:library class_name.cs (Note: class_name is the name of the class that you want to compile).

8, after the success you will see you just copied to the C drive after the class will follow a DLL (done).

Problems encountered:

1. The namespace "system" does not exist ...

WORKAROUND: Delete the other namespaces in the class, leaving only the using System;

Compiling a CS file to build a DLL file to compile the class into an assembly

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.