vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Build error during preLaunchTask 'build'.

Open liamdawson opened this issue 10 years ago • 23 comments

Whenever I press F5 to debug an RC2 ASP.Net app, I get the following error in a bar along the top:

Build error has been detected during preLaunchTask 'build'.

with a 'Debug Anyway' and 'Close' option.

I encounter the issue every time.

Build outputs associated with this:

Project Project.Omega (.NETCoreApp,Version=v1.0) will be compiled because Input items removed from last build
Compiling Project.Omega for .NETCoreApp,Version=v1.0
Compilation succeeded.
    0 Warning(s)
    0 Error(s)
Time elapsed 00:00:01.3013499
Project Project.Omega (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.

VS Code:

[Window Title]
Visual Studio Code - Insiders

[Main Instruction]
Visual Studio Code - Insiders

[Content]

Version 1.1.0-insider
Commit c212f0908f3d29933317bbc3233568fbca7944b1
Date 2016-05-09T13:09:51.092Z
Shell 0.37.6
Renderer 49.0.2623.75
Node 5.10.0

omnisharp-vscode package: csharp-1.0.5-rc2.vsix

In the project, I'm using Microsoft.NETCore.App version 1.0.0-rc2-3002700.

Debug Anyway works, but it's a pain to have to click that every time.

liamdawson avatar May 10 '16 01:05 liamdawson

Strangely enough, the issue stopped when I selected the (web) configuration in the debug tab, and I haven't been able to replicate it since.

liamdawson avatar May 10 '16 01:05 liamdawson

I just ran into this myself. Changing the launch configuration didn't help for me though, restarting VS Code made the issue go away.

caslan avatar May 10 '16 05:05 caslan

If you run into this on Windows, please try using Process Monitor to check the exit from dotnet.exe. Then we can know if this is a bug in VS Code (they are claiming the task failed for no reason), or a bug in the .NET CLI (they are exiting with non-zero exit code on success).

gregg-miskelly avatar May 10 '16 16:05 gregg-miskelly

I'm hitting the same issue. dotnet.exe is returning with exit code 0 according to Process Monitor.

image

image

image

mellinoe avatar May 10 '16 18:05 mellinoe

@mellinoe if you go to 'View->Errors and Warnings' does VS Code show you any errors?

This sounds like it might be https://github.com/Microsoft/vscode/issues/4987

gregg-miskelly avatar May 10 '16 20:05 gregg-miskelly

Looks like there is another active issue that also sounds the same: https://github.com/Microsoft/vscode/issues/4070

gregg-miskelly avatar May 10 '16 20:05 gregg-miskelly

Hm, I'm not able to get a repro at this exact moment. If I hit this again i will check that panel.

mellinoe avatar May 11 '16 23:05 mellinoe

I had the same issue on OSX. Restarted after updating C# extension and the asset installtion and it went away

jchannon avatar May 18 '16 12:05 jchannon

Has anyone seen this in awhile? It feels like this issue might be a bit stale.

DustinCampbell avatar Jul 21 '16 00:07 DustinCampbell

I have seen this issue with this repro https://github.com/OmniSharp/omnisharp-vscode/issues/352

rajkumar42 avatar Jul 21 '16 00:07 rajkumar42

Ah... Are these tracking the same thing then? This issue stuck out to me because it didn't have any labels or a milestone.

DustinCampbell avatar Jul 21 '16 00:07 DustinCampbell

@rajkumar42 this bug tracks the scenario where VS Code claims that the build fails, but it actually succeeded. Is that what you saw?

gregg-miskelly avatar Jul 21 '16 00:07 gregg-miskelly

This behavior shows up on Windows only. In my case the build actually failed, it did not update the dlls.

Its quiet different on mac, where it somehow creates a zero sized file.

rajkumar42 avatar Jul 21 '16 00:07 rajkumar42

Is this still a problem?

DustinCampbell avatar Feb 07 '17 19:02 DustinCampbell

I'm having the exact same problem with version 1.10.2 ;(

damtur avatar Mar 17 '17 16:03 damtur

Same goes here.

ghost avatar Mar 18 '17 01:03 ghost

@damtur and @cihadsevim what OSs are you guys on? What version of VS Code do you have?

gregg-miskelly avatar Mar 20 '17 20:03 gregg-miskelly

@gregg-miskelly Windows 8 VS version 1.10.2

ghost avatar Mar 21 '17 05:03 ghost

@cihadsevim can you repro this problem regularly? If so, could you try running procmon to verify that indeed dotnet (or whatever process you are using to build with if you have something else configured) is returning a non-zero exit code? You should be able to get back speed by disabling almost all events in procmon and enabling the option to drop filtered out events.

gregg-miskelly avatar Mar 21 '17 05:03 gregg-miskelly

@gregg-miskelly still same mate.

ghost avatar Mar 22 '17 04:03 ghost