Prelaunch task build terminated with exit code 1

DJman picture DJman · Feb 2, 2018 · Viewed 40.7k times · Source

I'm trying to learn how to create method libraries but whenever I run my program a little pop-up window (with a surprisingly basic Windows graphical interface, post-update) shows up with the message "PreLaunch task 'Build' terminated with exit code 1."

I click on "Show error" and in the "problems" tab I see the message "No problems in the workspace so far."

Does anyone know what's going on?

Here are my launch configurations...

launch configurations

launch configurations

launch configurations 2/2

launch configurations 2/2

Here is a screenshot of that pop-up window bearing the message.

pop-up window

pop-up window

Also, I'm not sure if this is related but I noticed that this stuff started happening after I moved the .NET SDK files to another folder, and also when the debugging shortcut command stopped working.

Answer

Culpepper picture Culpepper · May 14, 2018

I encountered the same error after renaming my project. The problems was that in my task.json file, the arguments were referencing my previous project csproj file.

task.json (old)

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "dotnet",
            "type": "process",
            "args": [
                "build",
                "${workspaceFolder}/MyOldProject.csproj"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

`

I changed the csproj file name to the current project's name it worked without any errors.