2017-08-27 14 views
2

ビジュアルコードで 'Start Debugging'をクリックすると、このエラーが発生します。どのGoogle検索結果も機能していないので、どうすれば修正できますか?私はC#コードをコンパイルしようとしています。VSコード:コンパイルできません。C#

The preLaunchTask 'build' terminated with exit code 1. 

私はそれがそれらを見ることができることに役立つであろうかどうかわからなかったので、私は私のlaunch.jsonファイルの下にいくつかのコードと私のVSコードの他のファイルを追加しました。

launch.json:

{ 
    "version": "0.2.0", 
    "configurations": [ 

     { 
      "name": ".NET Core Launch (console)", 
      "type": "coreclr", 
      "request": "launch", 
      "preLaunchTask": "build", 
      "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>", 
      "args": [], 
      "cwd": "${workspaceRoot}", 
      "stopAtEntry": false, 
      "console": "internalConsole" 
     }, 
     { 
      "name": ".NET Core Launch (web)", 
      "type": "coreclr", 
      "request": "launch", 
      "preLaunchTask": "build", 
      "program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.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": "0.1.0", 
    "command": "dotnet", 
    "isShellCommand": true, 
    "args": [], 
    "tasks": [ 
     { 
      "taskName": "build", 
      "args": [ ], 
      "isBuildCommand": true, 
      "showOutput": "silent", 
      "problemMatcher": "$msCompile" 
     } 
    ] 
} 

答えて

0

があなたのlaunch.jsonファイルで構成されたpreLaunchTaskあります。これは、スクリプトが実行される前に実行されるタスクです。そのタスクは、あなたのtasks.jsonファイルからビルドされています。ゼロ以外のエラーコードが返されたことで示されるように、失敗しています。 tasks.json設定ファイルを開いて、「ビルド」タスクが何をするかを確認し、それがなぜ失敗しているのかを理解する必要があります。

+0

私はtasks.jsonとlaunch.jsonで質問を更新しました。どうぞご覧ください。ありがとう。 –

関連する問題