-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings are not reported for repeated builds #3046
Comments
As mentioned in dotnet/cli#8722:
|
The pure-MSBuild way to achieve This is an entirely reasonable request but MSBuild's architecture makes it extremely difficult: the MSBuild engine itself does not have any state store to keep the previous build's warnings in. Its decision to run or not run a target can only look at the current state of files on disk in the current project's environment. We've discussed building a place to store that sort of state before (for example #701) and always come to the conclusion that it was too big/risky a change for too little gain. There is some discussion of the complexity involved in that issue. |
I do not know of any build toolchains that store warning states, nor any reason why we should expect warnings to be repeated if there is not cause to rebuild the file. |
This seems like it should be moved to the docs repo and documented. I ran into this same UX and was confused. |
Steps to reproduce
dotnet new classlib
Change Class1.cs to:
dotnet build
dotnet build
Expected behavior
The second
dotnet build
prints the CS1998 warning, just like the first one.Actual behavior
The second
dotnet build
does not print any warnings:Apparently, this happens because targets that are up to date are not re-run. Maybe warnings from previous builds could be saved somewhere and reported again when the target is skipped because it's up to date?
Environment data
dotnet --info
output:.NET Command Line Tools (2.1.300-preview2-008251)
Product Information:
Version: 2.1.300-preview2-008251
Commit SHA-1 hash: 94fd3fd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview2-008251\
Microsoft .NET Core Shared Framework Host
Version : 2.1.0-preview2-26131-06
Build : b13a0d5c331f374afd35ded57b9a4b4ab128864c
Originally reported as https://github.com/dotnet/cli/issues/8722.
The text was updated successfully, but these errors were encountered: