2017-08-07 106 views
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" 
    } 
] 

}

+0

如果運行在命令行'DOTNET build'會發生什麼? – Guvante

+0

如果我運行'dotnet build'it說:錯誤MSB4025:項目文件無法加載。根級別的數據無效。第1行,位置1. –

+0

首先猜測,您在項目文件的開始處有一個Unicode BOM。在VS Code中打開它,並確保狀態欄不會在任何地方提到BOM。你也可能不想壓制你的構建命令的輸出。 – Guvante

回答

1

如果tas k是爲了像我的情況一樣構建,你只需要爲dotnet ("command": "dotnet") -> ("command": "dotnet build")添加缺少的命令部分,或者任何你想做的任務。

我的JSON任務:

{ 
    "version": "2.0.0", 
    "tasks": [{ 
     "taskName": "build", 
     "command": "dotnet build", 
     "type": "shell", 
     "group": "build", 
     "presentation": { 
      "reveal": silent" 
     }, 
     "problemMatcher": "$msCompile" 
} 
相關問題