dotnet / project-system

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

Coordinate design-time build and full build errors/warnings #2784

Open davkean opened 7 years ago

davkean commented 7 years ago

We should coordinate design-time build and full build errors/warnings similar to what Roslyn does to avoid duplicate errors/warnings and errors/warnings showing up that have been fixed. ~We should also coordinate across configurations~.

davkean commented 6 years ago

All configurations now logs warnings/errors:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netcoreapp1.0;net45</TargetFrameworks>
  </PropertyGroup>

  <Target Name="Warnings" AfterTargets="ResolveProjectReferences">

    <Warning Text="netcoreapp1.0" Condition="'$(TargetFramework)'=='netcoreapp1.0'" />
    <Warning Text="net45" Condition="'$(TargetFramework)'=='net45'" />
  </Target>
</Project>

Results in:

Severity    Code    Description Project File    Line    Suppression State
Warning     net45   ConsoleApp169   c:\users\davkean\Source\Repos\ConsoleApp169\ConsoleApp169\ConsoleApp169.csproj  10  
Warning     netcoreapp1.0   ConsoleApp169   c:\users\davkean\Source\Repos\ConsoleApp169\ConsoleApp169\ConsoleApp169.csproj  9