Roslyn: CS8019 doesn't work during compilation

Created on 6 Oct 2017  路  8Comments  路  Source: dotnet/roslyn

Version Used: VS 2017 15.3.5

Steps to Reproduce:

  1. Create new Class Library (.NET Framework) project.
  2. Edit Active Rule Set and make CS8019 (Unnecessary using directive) an 'Error'.
  3. Compile project.

Expected Behavior:
Given that the project starts with a Class1.cs file containing unused using directives, compilation should fail.

Actual Behavior:
Compilation succeeds. The VS UI does show the IntelliSense error, however.

Attached repro project.
AnalyzerTest.zip

Area-IDE Bug Resolution-Duplicate

Most helpful comment

I'm still experiencing this issue too (exactly as described in original bug report), VS2019 16.4.3
The CS8019 error is reported by IntelliSense, yet the build finishes without error.

All 8 comments

Confirmed. Working on a fix.
This warning is reported separately from the other ones and wasn't undergoing the filtering that applies the diagnostic options.

Note to self: branch ruleset-bug

From discussion with @sharwell this should be handled in the IDE layer rather than the compiler layer, as this diagnostic is more of a code style. Thanks

Closing in favor of #28773

This is still a bug in Visual Studio 2019 16.4.2 as of now.

@mkamoski I am not aware of a bug currently in this space. If you are experiencing an issue with this diagnostic, can you file a new issue with the details so we can investigate it?

I'm still experiencing this issue too (exactly as described in original bug report), VS2019 16.4.3
The CS8019 error is reported by IntelliSense, yet the build finishes without error.

@yohny can you file a new issue so we can investigate?

Was this page helpful?
0 / 5 - 0 ratings