Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 program c# with it, but the setup document does not mention how to actually compile c# files.

You can define "mono" as a type in the "launch.json" file, but that does not do anything yet. Pressing F5 results in: "make sure to select a configuration from the launch dropdown"...

Also, intellisense is not working for c#? How do you set the path to any included frameworks?

Launch.json:

"configurations": [         {             // Name of configuration; appears in the launch configuration drop down menu.             "name": "Cars.exe",             // Type of configuration. Possible values: "node", "mono".             "type": "mono",             // Workspace relative or absolute path to the program.             "program": "cars.exe",         },          {             "type": "mono",         } 
like image 787
Kokodoko Avatar asked May 10 '15 09:05

Kokodoko


People also ask

What is the command to compile C?

Run the gcc command to compile your C program. The syntax you'll use is gcc filename. c -o filename.exe . This compiles the program and makes it executable.

How is C compiler compiled?

Usually, a first compiler is written in another language (directly in PDP11 assembler in this case, or in C for most of the "modern" languages). Then, this first compiler is used to program a compiler written in the language itself. You can read this page about the history of the C language.

How do I compile a C file in Windows?

Create a C source file and compile it on the command line. In the developer command prompt window, enter cd c:\ to change the current working directory to the root of your C: drive. Next, enter md c:\hello to create a directory, and then enter cd c:\hello to change to that directory.


Video Answer


1 Answers

Since no one else said it, the short-cut to compile (build) a C# app in Visual Studio Code (VSCode) is SHIFT+CTRL+B.

If you want to see the build errors (because they don't pop-up by default), the shortcut is SHIFT+CTRL+M.

(I know this question was asking for more than just the build shortcut. But I wanted to answer the question in the title, which wasn't directly answered by other answers/comments.)

like image 74
Brandon S Avatar answered Sep 21 '22 09:09

Brandon S