0
我已經安裝運行Linux Mint的設備上的Visual Studio,但每當我嘗試運行在Visual Studio C#程序則拋出了錯誤的Visual Studio:該preLaunchTask「建設」退出代碼爲終止129
The preLaunchTask 'build' terminated with exit code 129.
它給我的選項調試反正但隨後說:
No executable found matching command "dotnet-/home/XXXX/Documents/C# Practice/bin/Debug/netcoreapp1.0/HelloWorld.dll"
(XXXX是隻是簡單的,因爲我不希望分享我的名字)
這裏是launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/HelloWorld.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"console": "internalConsole"
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/HelloWorld.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
這裏是tasks.json文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
如果運行在命令行'DOTNET build'會發生什麼? – Guvante
如果我運行'dotnet build'it說:錯誤MSB4025:項目文件無法加載。根級別的數據無效。第1行,位置1. –
首先猜測,您在項目文件的開始處有一個Unicode BOM。在VS Code中打開它,並確保狀態欄不會在任何地方提到BOM。你也可能不想壓制你的構建命令的輸出。 – Guvante