Skip to content
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

Nulllable warnings do not show as errors with WarningsAsErrors #2292

Closed
MatisseHack opened this issue Dec 3, 2021 · 3 comments · Fixed by #2406
Closed

Nulllable warnings do not show as errors with WarningsAsErrors #2292

MatisseHack opened this issue Dec 3, 2021 · 3 comments · Fixed by #2406

Comments

@MatisseHack
Copy link

I am trying to use <WarningsAsErrors>nullable</WarningsAsErrors> in a project, but nullable warnings are still not showing as errors. This is a simple project file that exhibits the issue:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <WarningsAsErrors>nullable</WarningsAsErrors>
  </PropertyGroup>
</Project>

The warnings are properly treated as errors when running dotnet build, but don't work in the editor. These symptoms seem similar to dotnet/roslyn#38371

@furai
Copy link

furai commented Aug 9, 2024

Did this stop working in recent versions or do I need some extra config to make it work? It's not working for me currently.

EDIT: It seems there is some discrepancy with how msbuild vs omnisharp treats those. In msbuild it's enough to set <WarningsAsErrors>Nullable</WarningsAsErrors> and for ominsharp I still have to add individual CSxxxx to make it work which is less than ideal.

@furai
Copy link

furai commented Aug 14, 2024

Could we reopen this issue? Or should I create a new one? @JoeRobich

@JoeRobich
Copy link
Member

@furai Please create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants