I want to try out a new editor from Microsoft - Visual Studio Code. I want to implement a simple app (like Hello, World) and be able to debug it. But after a lot of googling and trying, I didn't manage to do that. Is that possible? I have Windows 10 with Visual Studio 2015 installed.
What I've tried to do:
1) Uncomment the following in the tasks.json file:
{ "version": "0.1.0", "command": "msbuild", "args": [ // Ask msbuild to generate full paths for file names. "/property:GenerateFullPaths=true" ], "taskSelector": "/t:", "showOutput": "silent", "tasks": [ { "taskName": "build", // Show the output window only if unrecognized errors occur. "showOutput": "silent", // Use the standard MS compiler pattern to detect errors, warnings // and infos in the output. "problemMatcher": "$msCompile" } ]
But compiling (ctrl-shift-b) fails with the error: "Failed to launch external program msbuild . spawn msbuild ENOENT"
2) Read this article: http://michaelcrump.net/creating-and-debugging-console-apps-with-vscode/, but I don't have any project.json file, also "dnx . run
" fails with the error "System.InvalidOperationException: Unable to resolve project"
Is there a simple way to run simple C# app in VS Code? I'm wondering why it's so complicated. Probably, I'm missing something, any ideas are welcome.
Update 1: Adding msbuild to path helps
C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.
Visual Studio Community. A fully-featured, extensible, free IDE for creating modern applications for Android, iOS, Windows, as well as web applications and cloud services.
Visual Studio is an excellent IDE for C++. If you know it from C#, it will be comfortably familiar.
The C# support in VS Code is optimized for cross platform .NET development (DNX) (see working with ASP.NET 5 and VS Code for another relevant article. Our focus with VS Code is to be a great editor for cross platfrom C# development - for instance many Unity developers have been enjoying using VS Code in place of Mono Develop.
We support debugging of C# apps cross platfrom via Mono (see Mono Debugging).
Due to this focus many standard C# project types are not recognised by VS Code. An example of a non-supported project type is an ASP .NET MVC Application. In these cases if you simply want to have a lightweight tool to edit a file - VS Code has you covered. If you want the best possible experience for those projects, and development on Windows in general we recomend you use Visual Studio Community.
from: code.visualstudio.com/Docs/languages/csharp
Update, June 2017:
C# is supported in Visual Studio Code using Microsoft's VS Code C# extension: https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp
This can be installed by searching for 'C#' in Extensions: Install Extension. Alternatively, opening a .cs
file should prompt to install extension.
This extension supports debugging of C# applications running on .NET Core or Mono, however does not support debugging applications running on the Desktop .NET Framework - Visual Studio Community is still recommended for full .NET project support.
For more info regarding VS Code's C# support, see https://code.visualstudio.com/docs/languages/csharp
For the marketplace page for the VS Code C# extension, see https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With