vscode \ task runnerがmsbuildを検出できないため、エラーFailed to launch external program msbuild . spawn msbuild ENOENT
が発生します。
ビジュアルスタジオコードエディタでasp.net mvc 4.5を実行するには、msbuildツール(私は2017バージョンをインストールしました)とIIS Expressをインストールする必要があります。
あなたは私の場合には、MSBuildの位置を確認するためにvswhereを使用することができコマンドTasks: Configure Task Runner
を実行し、ファイルをに従ってtasks.jsonの内容を編集vscodeでC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe
です。
{
"version": "0.1.0",
"taskSelector": "/t:",
"showOutput": "silent",
"tasks": [
{
"taskName": "build",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true"
],
"windows": {
// change according your msbuild location
"command": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
},
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
},
{
"suppressTaskName": true,
"taskName": "iisexpress",
"isShellCommand": true,
"windows": {
"command": "C:\\Program Files (x86)\\IIS Express\\iisexpress.exe"
},
"args": [
// change according your project folder and desired port
"/path:${workspaceRoot}\\MyProjectFolder",
"/port:51714"
],
// Show the iisexpress output always.
"showOutput": "always"
}
]
}
あなたは、あなただけのアプリケーションCTRL+SHIFT+B
を構築する必要があり、すべての変更にあなたのIISを再起動する必要はありません。
IISを停止することができない場合は、vscodeコマンドTasks: Terminate Running Task
を使用します。
参考文献:
https://stackoverflow.com/a/42719644/5270073
https://docs.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line
にgulpfileを見つけることができます。おそらく大きな頭痛を覚えるでしょう。 VSコードエディタは、あなたが望むことをするためのものではありません。 – ADyson
そうですね。とにかくありがとう。 – hmota