QRCoder.Unity icon indicating copy to clipboard operation
QRCoder.Unity copied to clipboard

System.Drawing.Common Compile Error

Open DogukanErdem opened this issue 5 years ago • 3 comments

Hi, I imported QRCoder.Unity using NuGet for Unity and I got these errors;

-Assembly 'Assets/Packages/QRCoder.1.3.4/lib/netstandard2.0/QRCoder.dll' will not be loaded due to errors: Unable to resolve reference 'System.Drawing.Common'. Is the assembly missing or incompatible with the current platform?

-Assembly 'Assets/Packages/QRCoder.Unity.1.0.2/lib/net35/QRCoder.Unity.dll' will not be loaded due to errors: Reference has errors 'QRCoder'.

-Assembly 'Library/ScriptAssemblies/Assembly-CSharp.dll' will not be loaded due to errors: Reference has errors 'QRCoder'.

Environment: Unity3D 2018.3.2f1 Scripting Runtime Version : .NET 4.x

DogukanErdem avatar Mar 07 '19 11:03 DogukanErdem

@DogukanErdem, I was wondering if you ever solved this problem since it also happened to me but the errors I had are these:

-Assembly 'Assets/Packages/QRCoder.1.3.4/lib/netstandard2.0/QRCoder.dll' will not be loaded due to errors: Unable to resolve reference 'System.Drawing.Common'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.

-Assembly 'Assets/Packages/QRCoder.Unity.1.0.2/lib/net35/QRCoder.Unity.dll' will not be loaded due to errors: Reference has errors 'QRCoder'.

The environment I was in is:

  • Unity 2019.2.3f1 Personal <DX11>
  • Scripting Runtime Version: .NET 2.0

When I tried changing it from .NET 2.0 to 4.x, I got 2 additional errors:

-Assembly 'Assets/Packages/QRCoder.1.3.4/lib/net40/QRCoder.dll' will not be loaded due to errors: Unable to resolve reference 'PresentationCore'. Is the assembly missing or incompatible with the current platform?Reference validation can be disabled in the Plugin Inspector.

-Assembly 'Assets/Packages/QRCoder.Unity.1.0.2/lib/net40/QRCoder.Unity.dll' will not be loaded due to errors: Reference has errors 'QRCoder'.

DrDragren avatar Nov 02 '19 12:11 DrDragren

If someone runs into this, this is how I got it working:

Download the following packages from nuget directly:

  • https://www.nuget.org/packages/QRCoder.Unity/
  • https://www.nuget.org/packages/QRCoder/
  • https://www.nuget.org/packages/System.Drawing.Common/ (open them as zip)

Add the following versions for each package as references (just add the dlls as assets) to the unity project:

  • for QRCoder.Unity add the .net 4.0 version
  • for QRCoder add the netstandard 2.0 version
  • for System.Drawing.Common add the netstandard 2.0 version

The environment I was in is:

  • Unity 2019.3.5f1 Personal
  • Scripting Runtime Version: .NET 4.x

shopsoft-srl avatar Apr 15 '20 11:04 shopsoft-srl

Little update what versions worked for me: the latest versions I could download did not work for me and I could not figure out how to switch to different net versions on NuGet for Unity. I ended up downloading the zip as @kinderplay mentioned but with these specific versions. Newer versions might work as well but these I checked:

Unity 2022.3.8f1

QRCoder.Unity.1.0.3 net4.0 QRCoder 1.3.7 net2.0 system.drawing.common.5.0.3 net2.0

sominklein avatar Sep 19 '23 14:09 sominklein