-
Notifications
You must be signed in to change notification settings - Fork 23
Enable CSC and MSBuild warning as errors #170
Comments
To be clear, you're talking about MSBuild warnings, not CSC warnings, right? |
I think both should be treated as errors by default, with exceptions as needed. My understanding is that our build is already configured to treat CSC warnings as errors, but we should verify. If true, then the only remaining work is to treat MSBuild warnings as errors. |
We already default to CSC warnings as errors.
|
We're pretty close to having eliminated all build warnings. We still have a few assembly conflicts, and we still have an issue with NuGet NuGet/Home#4587, but otherwise I think this is something we can do soon. |
FYI: This is not for preview1. We want to make sure that warnings-as-errors is enabled for both MSBuild and CSC. |
@mikeharder why did you change the assignment here? |
I thought @ryanbrandenburg could take this since he's working on other build-related stuff. Do you want to keep it? |
@mikeharder yes, this work naturally follows on after my work on API Check (aspnet/BuildTools#146). Both issues involve lots of local Universe builds 😺 Plus, I'm not fighting fires as @ryanbrandenburg is right now. Any objection to me taking this back @ryanbrandenburg or @mikeharder? |
It's yours. |
CSC warnings are currently limited to the MSBuild warnings fall into two categories:
|
FYI for context on |
@natemcmaster sure, action is necessary but these particular warnings should not fail our CI builds. I'm saying these particular warnings should not included in a broad "all warnings should be treated as errors" mandate, not that they should be hidden or ignored. In any case, we should have issues for all disabled tests already -- ready for triage decisions et cetera. Our teams have a clear preference for disabling tests temporarily over removing code (that'll come back soon-ish). |
One more piece of context...before upgraded to xunit.analyzers, we added this particular warning to CSC's On a separate note, MSBuild's flag
|
@natemcmaster: Good to know for dev scenarios, but I don't think this will impact the CI builds since they only build once. |
@mikeharder please check if there's any work left. |
We should ensure that warnings-as-errors is enabled by default for both MSBuild and CSC for
src
,test
, andsamples
in all repos. If needed, this can be disabled for individual repos/projects/warnings.This change should allow us to enable warnings-as-errors by default for MSBuild:
dotnet/msbuild#1366
It appears that CSC warnings are currently not be treated as errors, at least for the
Entropy\samples
projects (aspnet/Entropy#238). Also ensure this MSBuild/NuGet warning fromEntropy
would be an error: aspnet/Entropy#239.The Internal.AspNetCore.Sdk sets
WarningsAsErrors
:https://github.com/aspnet/BuildTools/blob/dev/src/Internal.AspNetCore.Sdk/targets/Common.props#L27
However, samples don't reference this SDK, so we'll need to find some other way to enable warnings-as-errors for samples.
The text was updated successfully, but these errors were encountered: