-
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
TreatWarningsAsErrors doesn't work for MSB3277 #5053
Comments
You can use the generic mechanism ("Ok, Rainer, but those aren't documented!" you might say. To which I preemptively reply: you're right! https://github.com/MicrosoftDocs/visualstudio-docs/issues/4660) |
Duplicate of #4421 |
Hi, Is there also an equivalent for |
@wouterroos that's #3062. |
@rainersigwald Thanks for your response. How would this work when setting properties in *.csproj files? I have the following scenario: We have set |
@wouterroos There's no way to make it appear as a warning today. You can either suppress it entirely or turn off warnings-as-errors in those projects. The issue I linked would allow you to get the behavior you want but isn't implemented. |
@rainersigwald just to make sure I'm understanding this correctly. I believe my case is similar to @wouterroos ' in that "I want to handle everything as an error by default, with the exception of specific warnings that should be whitelisted". We were previously using he I then found out about Is The only way I got it to work was by not setting Are there any short-term plans to fix all this confusion and adopt a unified approach that allows both whitelist and blacklist strategies for warnings? Apologies if this was already answered, but this is all very confusing and unintuitive to me. The very fact that we have separate I'm hesitant of relying on EDIT: Also, I found this post from you in another thread, suggesting that |
@julealgon, the compiler and MSBuild sometimes handle flags like TreatWarningsAsErrors the same way but sometimes don't. In this case, MSBuild didn't recognize WarningsNotAsErrors as a thing in all cases. The compiler was upgrading warnings other than 612 and 618 to errors, and MSBuild wasn't changing any warnings to errors. When you added MSBuildTreatWarningsAsErrors, it was taking all warnings (given to it by the compiler as well as other sources) and converting them to errors—and since WarningsNotAsErrors was only a compiler thing, there were no exceptions. One difficulty from a design perspective is that MSBuild can run without any specific compiler and vice versa, hence having disjoint systems. In any case, I merged the feature for specifying just a few warnings to not be errors yesterday, so it should hopefully come out in 17.2. Hope that helps! |
Due to upgrades made in #608 , the dreaded warning
MSB3277 Found conflicts between different versions of the same dependent assembly that could not be resolved.
is now (somewhat) easily actionable from the Visual Studio. However, in times of CI/CD and https://dependabot.com/ , I don't want to have to wait for a deployment to fail in order to notice that MSBuild already knew at build time my project won't start.However, no matter how strict the MSBuild settings are, this is always emitted as warning, not error.
Please make the MSB3277 respect TreatWarningsAsErrors and related flags.
Related (6 year old, still valid) StackOverflow thread https://stackoverflow.com/q/23662639/3205
The text was updated successfully, but these errors were encountered: