Configure SharpDevelop to compile a single CS file

Source: Internet
Author: User
Tags sharpdevelop

Recently began to learn C #, to see the Chen Guang Teacher's tutorial, the video with the development tool is sharpdevelop, the tool does not compile a single file function, the establishment of a large pile of documents too much trouble, Baidu found a bit of relevant information is very little (or I can not find information ability), and then found a good article " How to compile a single CS file: http://xloved.blog.163.com/blog/static/18571909420114854026152/", the effect is really good after the attempt, the individual on this basis to improve a little improvement.

 

First step: Create a bat batch. Create a consolecomplier.bat batch file with Notepad that reads as follows:

C:\windows\microsoft.net\framework\v4.0.30319\csc.exe/t:exe%1

%~n1

@pause

Del%~n1.exe

Explain:

First line: To. NET directory down with the csc.exe compiler to compile the current CS file, the path parameter is provided by the SD "${itempath}"

Second line: Execute the compiled EXE file

Third line: Prompt "Press any key to continue", waiting for user input

Row four: Delete the compiled generated EXE file for the next recompile preparation.

Step two: Set the SD. Save the Complier.bat anywhere (I put it in the SD installation directory), open the SharpDevelop, tools----tools----tool---and expand Tools, by setting the menu bar.

Click "Add" button to add a tool, the title is called "Consolecomplier" or "Complie and Run" What to do with it, and then note that the command column is just the path of the Complier.bat, parameters: "${itempath}" (including double quotes), working directory: ${itemdir} (no double quotes), click on the "Move Up" button to move our tool to the first, finally click on the "OK" button to save the settings, done!

Step three: use. Click on the menu Bar Tool menu, you can see the tools we added, click to use, since we have moved it to the top, so the use of the shortcut "Alt+t+enter" can be called, is it convenient?

Summary: In the process of modifying batch processing to find their own batch processing knowledge is very scarce, there is time (hehe) must be a bad fix ...

Configure SharpDevelop to compile a single CS file

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.