How to compile c# in Microsoft's new Visual Studio Code?

前端 未结 4 1963
无人共我
无人共我 2020-12-02 10:35

I have installed the preview version of Microsoft\'s new code editor \"Visual Studio Code\". It seems quite a nice tool!

The introduction mentions you can p

4条回答
  •  清歌不尽
    2020-12-02 10:52

    Intellisense does work for C# 6, and it's great.

    For running console apps you should set up some additional tools:

    • ASP.NET 5; in Powershell: &{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
    • Node.js including package manager npm.
    • The rest of required tools including Yeoman yo: npm install -g yo grunt-cli generator-aspnet bower
    • You should also invoke .NET Version Manager: c:\Users\Username\.dnx\bin\dnvm.cmd upgrade -u

    Then you can use yo as wizard for Console Application: yo aspnet Choose name and project type. After that go to created folder cd ./MyNewConsoleApp/ and run dnu restore

    To execute your program just type >run in Command Palette (Ctrl+Shift+P), or execute dnx . run in shell from the directory of your project.

提交回复
热议问题