dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Error list does not always contain all errors from the build output #1470

Open nguerrera opened 7 years ago

nguerrera commented 7 years ago

Repro Steps

Create a 1.1 NET Core project (there are templates in VS for 1.1 web projects) Add a unit test project - the default template in VS targets NetCore 1.0 Add a ref from the test project to the first one. Build

It is not happening to me, but I've seen this in two different instances on @jinujoseph's machine.

https://github.com/dotnet/sdk/issues/798#issuecomment-277329066

Output Window:

1>------ Build started: Project: WebApplication1, Configuration: Debug Any CPU ------
1>WebApplication1 -> C:\Users\jinuj\documents\visual studio 2017\Projects\WebApplication1\WebApplication1\bin\Debug\netcoreapp1.1\WebApplication1.dll
2>------ Build started: Project: UnitTestProject2, Configuration: Debug Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(69,5): error : Project 'C:\Users\jinuj\documents\visual studio 2017\Projects\WebApplication1\WebApplication1\WebApplication1.csproj' targets '.NETCoreApp,Version=v1.1'. It cannot be referenced by a project that targets '.NETCoreApp,Version=v1.0'.
2>Done building project "WebApplication1.csproj" -- FAILED.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets(76,5): error : Cannot find project info for 'C:\Users\jinuj\documents\visual studio 2017\Projects\WebApplication1\WebApplication1\WebApplication1.csproj'. This can indicate a missing project reference.
2>Done building project "UnitTestProject2.csproj" -- FAILED.
========== Build: 1 succeeded or up-to-date, 1 failed, 0 skipped ==========

Error List:

image

@davkean @srivatsn This is especially bad because in both instances I've seen it, there were helpful messages in the output that are harder to read there and the error list picked up only secondary consequences of the root problem with undecipherable messges.

jinujoseph commented 7 years ago

Adding the repro steps above.

davkean commented 7 years ago

What is that second error? Is that coming from assets targets? We should also avoid outputting if the reference failed to resolve.

nguerrera commented 7 years ago

@davkean Good point. I filed dotnet/sdk#829 for that. Of course, it's completely separate and less severe than the general issue of missing errors in error list.

davkean commented 7 years ago

Yep absolutely,

davkean commented 7 years ago

Was a "build" always involved?

nguerrera commented 7 years ago

I believe so. @jinujoseph ?

jinujoseph commented 7 years ago

thatz right build was always involved.

srivatsn commented 7 years ago

@heejaechang any idea what's going on here - is this related to the issue where the Roslyn package is not initialized soon enough?

heejaechang commented 7 years ago

@srivatsn sounds like same issue. let me check.

heejaechang commented 7 years ago

this is dup of https://github.com/dotnet/roslyn-project-system/issues/1411

nguerrera commented 7 years ago

Still seeing some errors not propagate to error list. See dotnet/sdk#910 for repro.

rainersigwald commented 7 years ago

Is this because the error is actually thrown from the referenced project, when it detects that it can't satisfy the TFM requested by the referencing project?

nguerrera commented 7 years ago

I think so. Dave mentioned that at some point but I can't find the issue.

srivatsn commented 7 years ago

Is this related to #1510 or #1511?

srivatsn commented 7 years ago

@davkean this sounds related to #1510 or #1511 and should get fixed with the CPS changes?

davkean commented 7 years ago

@srivatsn No those look unrelated.