Skip to content

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Jun 20, 2023

I have an extra value NoWarn value in my Directory.Build.props.user.
This would allow it to come through in src/FSharp.Build/FSharp.Build.fsproj.

PS: When do you use <NoWarn>$(NoWarn);75</NoWarn> versus <NoWarn>FS0075</NoWarn>?

@nojaf nojaf requested a review from a team as a code owner June 20, 2023 11:36
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think <NoWarn>$(NoWarn);(all the other warnings)</NoWarn> is the right approach.

@nojaf
Copy link
Contributor Author

nojaf commented Jun 20, 2023

@psfinaki I was more referring to the 75 versus FS0075? Do both mean the same thing?

@psfinaki
Copy link
Contributor

Hmm I suspect MSBuild would default a random number to C# compiler warnings. I cannot find explicit docs on that, although these explanations kind of imply that. Either way, FS0075 is more safe and explicit.

@baronfel
Copy link
Member

@psfinaki it's not an MSBuild behavior, rather Roslyn chooses to interpret pure numbers as having the CS prefix. This is not considered good practice anymore in a world of many different components providing diagnostics (analyzers, linker, nuget, etc) and so we should always fully qualify these days.

@KevinRansom KevinRansom merged commit 84d5c03 into dotnet:main Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants