microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 304 forks source link

Version Conflict on AutomaticGraphLayout.Drawing due to PublicKeyToken differences. #243

Closed rurounijones closed 4 years ago

rurounijones commented 4 years ago

Describe the bug

Using both QuikGraph.MASAGL and AutomaticGraphLayout.WpfGraphControl in the same project causes an unfixable version conflict due to a difference in the PublicKeyToken on AutomaticGraphLayout.Drawing dependency.

QuikGraph.MASAGL uses AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4

AutomaticGraphLayout.WpfGraphControl uses AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"

Now, I am not entirely sure who is correct here. I am assuming that WpfGraphControl is correct since it is part of the same project but since I am not massively familiar with the nuance and having a public key sounds more correct than not.

Error displayed in Visual Studio is The type 'Graph' is defined in an assembly that is not referenced. You must add a reference to assembly 'AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4'.

Full build log output (Detailed) here:

  There was a conflict between "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" and "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4".

      "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4" was not.

      References which depend on "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" [C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\AutomaticGraphLayout.Drawing.1.1.7\lib\netstandard2.0\AutomaticGraphLayout.Drawing.dll].
          C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\AutomaticGraphLayout.Drawing.1.1.7\lib\netstandard2.0\AutomaticGraphLayout.Drawing.dll
            Project file item includes which caused reference "C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\AutomaticGraphLayout.Drawing.1.1.7\lib\netstandard2.0\AutomaticGraphLayout.Drawing.dll".
              AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
              Microsoft.Msagl.WpfGraphControl, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
          C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\AutomaticGraphLayout.WpfGraphControl.1.1.7\lib\net472\Microsoft.Msagl.WpfGraphControl.dll
            Project file item includes which caused reference "C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\AutomaticGraphLayout.WpfGraphControl.1.1.7\lib\net472\Microsoft.Msagl.WpfGraphControl.dll".
              Microsoft.Msagl.WpfGraphControl, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL

      References which depend on "AutomaticGraphLayout.Drawing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4" [].
          C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\QuikGraph.MSAGL.2.2.0\lib\netstandard2.0\QuikGraph.MSAGL.dll
            Project file item includes which caused reference "C:\Users\jeff\source\repos\DCS-SimpleRadioStandalone\packages\QuikGraph.MSAGL.2.2.0\lib\netstandard2.0\QuikGraph.MSAGL.dll".
              QuikGraph.MSAGL, Version=2.2.0.0, Culture=neutral, PublicKeyToken=46bd58b0789759cb, processorArchitecture=MSIL

To Reproduce Create a project containing both QuikGraph.MASAGL and AutomaticGraphLayout.WpfGraphControl and try to generate an MSAGL graph using the ToMsaglGraph() method.

Based on my understanding of this there is no way to fix this with something like assemblyBindings (e.g. https://stackoverflow.com/questions/2191296/net-assembly-binding-redirect-with-differing-public-key-tokens )

Expected behavior No version conflicts or missing references.

Notes

As I am not sure who is the one to be making changes I am raising this issue in both repositories: https://github.com/KeRNeLith/QuikGraph/issues/9

rurounijones commented 4 years ago

Closing in favour of https://github.com/microsoft/automatic-graph-layout/issues/241