sergey-tihon / Clippit

Fresh PowerTools for OpenXml
https://sergey-tihon.github.io/Clippit/
MIT License
47 stars 18 forks source link

System.Drawing.Common packaging issue #23

Closed smkanadl closed 3 years ago

smkanadl commented 3 years ago

I tried to use Clippit as a replacement for the old OpenXmlPowerTools package (which seems to work fine function wise), but in one place I use it in combination with System.Drawing.Common. In that specific project I was using version 4.7.0 which worked ok with the old package, but with Clippit I get some nuget warning:

Warning MSB3277 Found conflicts between different versions of "System.Drawing.Common" that could not be resolved.
There was a conflict between "System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
    "System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.

I had a quick look at the code in your repo, but I am not very familiar with paket. To me it looks like Clippit has a dependency on System.Drawing.Common (as it pulls its as package reference) but does not propagate this in the nuget package dependencies.

sergey-tihon commented 3 years ago

What is your target framework? If it is full framework you should be able ask MSBuild to generate binding redirect for your project https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection#disable-manually-in-the-project-file

sergey-tihon commented 3 years ago

You also may try v1.5.0-beta4 with updated dependencies

smkanadl commented 3 years ago

Hi, yes, I was targeting net48, but I was sure to have the binding redirects activated. I'll try the beta-4 on Monday. Thank you very much so far!

smkanadl commented 3 years ago

@sergey-tihon Hi, I tried the beta4 and it works perfectly for my use case. Many thanks!