v1n*_*ozo 6 c# windows visual-studio-code
问题非常简单.使用VS Code(不是visual studio),我已经能够使用dnx run命令运行它但是我应该如何要求任何人安装它以运行应用程序?
换句话说,是否可以从VS代码生成可执行文件?
更新1:
选定的答案几乎完成.我必须下载Microsoft Build Tools才能使用msbuild,还必须创建一个.csproj文件,这个文件不是我用来创建项目的Yeoman生成器提供的.
这不是应该的那么简单,但是这样做的方法是通过命令调色板(F1键)和类型run task,它应该如下所示:
单击此按钮后,您可能会收到一个错误,其中没有创建任务运行器,您可以按下按钮或返回命令面板并编辑任务运行程序.
这样做是创建一个带有tasks.json文件的.vscode目录,你可以翻找并取消注释msbuild部分,或者只是将其粘贴为覆盖:
{
"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"
}
]
}
Run Code Online (Sandbox Code Playgroud)
完成后,您可以编辑您的构建规范,命令面板或CTRL + SHIFT + B将运行构建器.以下是visual Studio Code中 Tasks:Tasks的链接信息