dotnet / format

Home for the dotnet-format command
MIT License
1.94k stars 172 forks source link

Issue with PackageReferences in .NET Framework project #1635

Open epenet opened 2 years ago

epenet commented 2 years ago

I am running format check by running following command dotnet-format ./MySolution.sln --fix-style warn --check -v diag.

The solution contains a VB.NET Winform project which references a Nuget package using PackageRefence.

The inheritance is as follows: CustomForm (in my project) -> BaseForm (in NuGet project) -> Form

Using the following code, dotnet-format always reports a BC30512 error because it does not recognise that Me implements IWin32Window through inheritance:

    Using dialogForm As New SaveFileDialog
      If dialogForm.ShowDialog(Me) = DialogResult.OK Then
        'Do nothing
      End If
    End Using

Even if I add dotnet_diagnostic.BC30512.severity = none in the .editorconfig the output still contains the BC30512 error code.

Probably related to #1061 and #1627

epenet commented 2 years ago

Testing with v6 seems to be ok: dotnet format style ./MySolution.sln --verify-no-changes --severity warn --verbosity diag