How to create a basic C # program in Visual Studio Code?

I have looked all over the internet and stackoverflow for guides, but VS Code looks very bare. I tried to make a simple Hello World program, but the IDE complains about things like tasks.json and launch.json (which it generated for me ... to some extent), but I don't know what values โ€‹โ€‹to enter anything there . He also asked for project.json, which he did not generate, so I did one (and, oddly enough, it doesn't fall under .vscode with other files?). I have no idea what settings to include in this project.json and all the documentation I found about this is very general. I also had to do project.lock.json for some reason, whatever that is.

Is there a tutorial on how to use it somewhere? I just want to make the world a simple basic console program in C #. The only guides I could find were for ASP.NET that I didn't care about.

.Json project I put together:

{ "version": "0.1-alpha-*", "compilationOptions": { "warningsAsErrors": true }, "dependencies": { }, "code": ["**/*.cs"], "frameworks": { "dotnet": {} } } 

Am I using "mono" instead of "dotnet"? Where is the document for this?

My launch.json:

 { "version": "0.1.0", "configurations": [ { "name": "Debug ConsoleApplication", "type": "coreclr", // or "mono"? "request": "launch", "preLaunchTask": "build", "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>", "args": [], "cwd": "${workspaceRoot}", "stopAtEntry": false } ] } 

Where is the "workspaceRoot" defined? In a .json project? How?

My .json tasks:

 { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "0.1.0", "command": "dotnet", "isShellCommand": true, "args": [], "tasks": [ { "taskName": "build", "args": [ ], "isBuildCommand": true, "showOutput": "silent", "problemMatcher": "$msCompile" } ] } 

This is normal? Will this work with Linux / mono?

+6
source share

All Articles