sublime text配置编译C#环境
参照:http://www.cnblogs.com/Bob-wei/p/4670341.html
添加C#支持(Windows)
1) 配置环境变量 Path
C# 6.0编译器:可以将csc.exe所在位置 C:\Program Files (x86)\MSBuild\14.0\Bin 添加到Path环境变量
C# 5.0编译器:仍然在原来的位置 C:\Windows\Microsoft.NET\Framework\v4.0.30319 或者 C:\Windows\Microsoft.NET\Framework64\v4.0.30319
2)添加 CSharp Build 配置
{ "shell_cmd": "csc /out:\"${file_path}/${file_base_name}.exe\" \"${file}\"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.cs", "variants": [ { "name": "Build & Run", "shell_cmd": "csc /out:\"${file_path}/${file_base_name}.exe\" \"${file}\" && start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"", "working_dir": "${file_path}" }, { "name": "Run", "shell_cmd": "start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"", "working_dir": "${file_path}" }, { "name": "Build (Form)", "shell_cmd": "csc /t:winexe /r:System.Windows.Forms.dll;System.Drawing.dll /out:\"${file_path}/${file_base_name}.exe\" \"${file}\"", "working_dir": "${file_path}" }, { "name": "Build & Run (Form)", "shell_cmd": "csc /t:winexe /r:System.Windows.Forms.dll;System.Drawing.dll /out:\"${file_path}/${file_base_name}.exe\" \"${file}\" && start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"", "working_dir": "${file_path}" }, { "name": "Run (Form)", "shell_cmd": "start \"${file_base_name}.exe\" /d \"${file_path}\" \"${file_base_name}.exe\"", "working_dir": "${file_path}" }, ] }
另存为utf8格式的,保存为csharp.sublime-build
3)然后编辑.cs文件,就可以按Ctrl+Shift+B(Tools -> Build With...),选择编译方法,按Ctrl+B(Tools -> Build)进行编译了
作者:小羽信息
出处:http://www.cnblogs.com/fer-team/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。