8

The question is pretty straightforward. Using VS Code (not visual studio), I've been able to run it using the dnx run command but how am i supposed to ask for anyone to install it in order to run the application?

In other words, is it possible to generate an executable from VS code?

Update 1:

The selected answer is almost complete. I had to download the Microsoft Build Tools in order to use msbuild, and also had to create a .csproj file, which wasn't provided by the Yeoman generator i used to create the project.

4
  • You just compile to an .exe file and deploy it. Where does dnx come into this? Does this help? msdn.microsoft.com/en-us/library/k1sx6ed2.aspx Commented Feb 22, 2016 at 1:58
  • i'm using vscode, no visual studio. I guess i can compile using the command line in that case Commented Feb 22, 2016 at 2:19
  • 3
    Wow I had no idea VSCode even existed up till now! Thank you for educating me :) Commented Feb 22, 2016 at 3:10
  • 1
    no problem mate hahaha Commented Feb 22, 2016 at 4:48

1 Answer 1

9

This is not as simple as it should be, but the way to do this is through the command palette (F1 key) and type run task, it should look like this:

F1 Command Palette Run Task

After you click this you will probably get an error in which you do not have a task runner created, you can either press the button or go back to the command palette and edit task runners.

What this will do is create a .vscode directory with a tasks.json file in it, you can either rummage through and uncomment the msbuild section or simply paste this as an override:

{ "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" } ] } 

Once you've done that you can edit to your build specifications and either the command palette or CTRL+SHIFT+B will run the builder. Here is the link information for the Tasks: Tasks in visual Studio Code

Sign up to request clarification or add additional context in comments.

5 Comments

I will try this one, but just to make it clear, it will generate a fully executable?
because all i managed to do thus far is to generate a *.cmd file that won't run unless i use 'dnx run' on a command prompt
@v1n1akabozo When configured with this you are running MSBUILD. Just as if you were compiling from the command line.
Just found this out by myself hahaha. Only issue is that it won't work because this tasks file is on another folder, in which there's nothing to build. How can i target the build to a upper folder?
managed to make it work by creating a csproj file for the project. Yeoman generator won't create one and that's why it wasn't working properly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.