zoukankan      html  css  js  c++  java
  • 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)MSBuild14.0Bin 添加到Path环境变量
       C# 5.0编译器:仍然在原来的位置 C:WindowsMicrosoft.NETFrameworkv4.0.30319 或者 C:WindowsMicrosoft.NETFramework64v4.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)进行编译了

  • 相关阅读:
    安装VisualStudio时失败,错误信息安装包失败或证书不在有效期内
    解决方案看起来是受源代码管理,但无法找到它的绑定信息。由于无法自动恢复这些缺少的信息,缺少绑定的项目将被视为不受源代码管理。
    ASP.NET+MVC+EntityFramework快速实现增删改查
    C#服务端Web Api
    Android DrawerLayout侧滑菜单
    Redis的简单使用
    windows10安装sqlmap与简单配置

    并发编程
    网络基础知识
  • 原文地址:https://www.cnblogs.com/fer-team/p/7269391.html
Copyright © 2011-2022 走看看