Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to config task to run/debug C# console app in vscode

from //build, i see the coolness of running nodejs and asp net 5 i am trying to use vscode to run some basic C# console app. how should i config the task to build and run/debug it? is there any sample?

like image 363
jojo Avatar asked May 01 '15 02:05

jojo


1 Answers

The yeoman aspnet generator has a ConsoleApplication template that will work in VSCode.

  1. Install ASP.NET and DNX (according to your OS see the instructions here: https://code.visualstudio.com/Docs/ASPnet5)

  2. Install yeoman dependencies and generate a yeoman aspnet project (choose Console Application)

    npm install -g yo grunt-cli generator-aspnet bower

    yo aspnet

  3. cd to your project dir you just created and:

    dnu restore

  4. Now you can open the dir in VSCode. Open the command palette (command-shift-P) and type run

EDIT: Note however that while mono-based C# debugging works in Linux and OSX, ASP.NET 5 debugging does not yet work in the preview version.

like image 76
Andrew Lavers Avatar answered Nov 08 '22 14:11

Andrew Lavers