VSCode tasks.json args不像预期的MSBuild解析
我想将输出更改为另一个目录。在我的dotnet构建args中添加“Z:/${workspaceFolderBasename}/bin/Debug/netcoreapp3.0/”-o“没有工作。( MSBUILD的错误:错误MSB1001:未知开关)
解决方案:添加两个args "-o“和"OutputPath”而不是"-o OutputpPath“
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Core3WinForms.csproj",
// "-o Z:/${workspaceFolderBasename}/bin/Debug/netcoreapp3.0/" // that one won't work
"-o",
"Z:/${workspaceFolderBasename}/bin/Debug/netcoreapp3.0/"
],
"problemMatcher": "$msCompile"
}
]
}产出:
执行任务:C:\ Files\dotnet\dotnet.exe Files\dotnet\dotnet.exe build -o >Z:/Core3WinForms/bin/Debug/netcoreapp3.0/ < Microsoft (注册商标)-构建引擎,版本16.0.225-预览+g5ebeba52a1 für .NET核心版权(C) Microsoft Corporation。这是我的工作。 错误MSB1001: Unbekannter。-o Z:/Core3WinForms/bin/Debug/netcoreapp3.0/ 参考资料:MSBuild/help。终端进程以退出代码结束:1 终端将被任务重用,按任意键关闭它。 执行任务:C:\ Files\dotnet\dotnet.exe Files\dotnet\dotnet.exe build -o Z:/Core3WinForms/bin/Debug/netcoreapp3.0/ < Microsoft (注册商标)-构建引擎,版本16.0.225-预览+g5ebeba52a1 für .NET Core版权(C) Microsoft Corporation。这是我的工作。 韦德赫斯特在"49,17毫秒“für "C:\Dev\NoControl\Core3WinForms\Core3WinForms.csproj”abgeschlossen。C:\ Files\dotnet\sdk\3.0.100-preview-009812\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(142,5):消息NETSDK1057: Sie einer Vorschauversion des .NET Core。Sie k nnen die SDK-Versionüber eine Datei "global.json“im aktuellen Projekt definieren。我们提供了信息,找到了https://go.microsoft.com/fwlink/?linkid=869452。C:\Dev\NoControl\Core3WinForms\Core3WinForms.csproj Core3WinForms -> Z:\Core3WinForms\bin\Debug\netcoreapp3.0\Core3WinForms.dll 建设,建设,发展,发展。0 Warnung(en) 0 Fehler 韦斯特里尼·泽特00:00:02.63
执行任务:C:\ Files\dotnet\dotnet.exe build Files\dotnet\dotnet.exe -o Z:/Core3WinForms/bin/Debug/netcoreapp3.0/ <应该工作得很好。
发布于 2018-12-22 13:43:43
添加两个args "-o“和"OutputPath”而不是"-o OutputpPath“
仍然不确定这是一个bug还是一个特性,VSCode,这到底是谁的错?MSBuild?也许是我的错,使用内部构建(VSCode)和预览(netcore 3),但这个解决方案对我有效。
我只是为了帮助别人,而不是为了推动我的代表,我不在乎。
https://stackoverflow.com/questions/53896117
复制相似问题