PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Could not load assembly 'System.Drawing.Common, Version=4.0
http://forum.pdfsharp.com/viewtopic.php?f=2&t=3865
Page 1 of 1

Author:  wizengamot [ Fri Oct 26, 2018 2:37 pm ]
Post subject:  Could not load assembly 'System.Drawing.Common, Version=4.0

Ran into a bit of a problem using PDFSharpNetStandard2. I referenced the library from the solution level for my Android/iOS cross platform app. It said to install it for all the platforms which I did. I clicked on all three projects (xamarin forms app, android app, iOS app). It installed fine and I was able to develop against it.

However, when I went to compile the code it said that it was missing a reference to System.Drawing.Common 4.0.0.0 in the android solution. Looked in the solution could not find that reference. Thought it was missing so I went to remove PDFSharp and when I clicked the remove, the confirmation dialog asked my if I wanted to remove PDFSharp and System.Drawing.Common 4.5.0

I could not find System.Drawing.Common 4.0.0.0 anywhere.

When I searched online, one answer on the xamarin site said that I should close VS and remove the Packages folder for the solution and restart. I was unable to locate a packages folder in my solution directory so this option has been un-tested. I have deleted the packages folder for other project types (windows forms) in the past to resolve other types of conflicts so this would not likely be a case of PEBKAC but I suppose the possibility exists. I am open to all possibilities.

I have removed PDFSharpNetStandard2 and the problem resolves itself. (of course I have comment out my pdf code).

I have also tried to update the System.Drawing.Common to 4.5.1 (via nuget) and this still does not resolve the issue (not that I expected it would).

I have tried removing PDFSharpNetStandard2 and reinstalling it. When it installs it states that it is installing System.Drawing.Common 4.5.0.0.

All the other binaries are the latest, Xamarin forms 3.3 and the Xamarin.Android.Support is v4 and v7 for AppCompat, CardView, and MediaRouter.
The only other references I am using are newtonsoft (for json), signature pad, and plugin settings. Shortly I'll be adding CrossMessaging for email support, but as of this writing its not there.

If anyone has an idea as to what I could be doing incorrectly, I would be most grateful for any suggestions.

Cheers,
Wiz


Exact copy of Error in case it helps


Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Drawing.Common.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) JobInfo.Android

Author:  TH-Soft [ Fri Oct 26, 2018 2:44 pm ]
Post subject:  Re: Could not load assembly 'System.Drawing.Common, Version=

Hi!
wizengamot wrote:
Ran into a bit of a problem using PDFSharpNetStandard2.
Not an official library. I can't help you.

Author:  wizengamot [ Fri Oct 26, 2018 8:11 pm ]
Post subject:  Re: Could not load assembly 'System.Drawing.Common, Version=

Thanks anyway. I posted because the Nuget package links back to your official site, so I naturally assumed it was an official package. Is someone linking back to you that shouldn't?

Author:  TH-Soft [ Fri Oct 26, 2018 8:43 pm ]
Post subject:  Re: Could not load assembly 'System.Drawing.Common, Version=

wizengamot wrote:
Is someone linking back to you that shouldn't?
They didn't ask.
I can link to Microsoft - but that won't make my file a Microsoft product, will it?

Their version number is higher than ours ...

wizengamot wrote:
I posted because the Nuget package links back to your official site, so I naturally assumed it was an official package.
You can contact the "package owners" on NuGet.
You can ask general PDFsharp questions here, but your question is specific to the ported version.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/