telerik/JustAssembly

JustAssembly.CommandLineTool.Exe gives wrong XML output when detecting decreased class visibility

Opened this issue · 0 comments

What are you seeing?

JustAssembly.CommandLineTool.exe XML output indicates member is more visible instead of less when class visibility is changed from public to internal.

<Assembly Name="Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DiffType="Modified">
  <Module Name="Test.dll" DiffType="Modified">
    <Type Name="Test.Calculator2" DiffType="Modified">
      <DeclarationDiffs>
        <DiffItem DiffType="Modified">Member is more visible.</DiffItem>
      </DeclarationDiffs>
    </Type>
  </Module>
</Assembly>

What is expected?

  <Assembly Name="Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DiffType="Modified">
    <Module Name="Test.dll" DiffType="Modified">
      <Type Name="Test.Calculator" DiffType="Modified">
        <DeclarationDiffs>
          <DiffItem DiffType="Modified">Member is ***less*** visible.</DiffItem>
        </DeclarationDiffs>
      </Type>
    </Module>
  </Assembly>

How did you get this to happen?

  • Create simple public class
    public class Calculator2
    {
        public int Subtract(int a, int b)
        {
            return a - b;
        }
    }
  • Compile and create a local copy of the dll ("previous" version)
  • Change the class visibility to internal
    internal class Calculator2
    {
        public int Subtract(int a, int b)
        {
            return a - b;
        }
    }
  • Compile again and create a local copy of the dll ("current" version)
  • Run JustAssembly.CommandLineTool.exe against the previous and current versions.

"C:\Users\xxx\.nuget\tools\JustAssembly\Justassembly.commandlinetool.exe" "C:\TEMP\Previous\test.dll" "C:\TEMP\Current\test.dll" "output.xml"