question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 6.0 - TypeLoadException

See original GitHub issue

Type of issue

[X] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

Should load the assembly.

Current Behavior

Referencing the library throws a TypeLoadException, with zero information. This happens when targeting .NET 6.0, and the actual dll copied to the bin folder is that of the .NET 6.0 (~120KB).
When overwriting with the .NET Standard dll, or the .NET 5.0 dll - it works.

Possible Solution (optional)

Recompile?

Steps to Reproduce (for bugs)

  1. New project
  2. Target .NET 6.0
  3. Reference QRCoder 1.4.3
  4. Reference any class from the library

Your Environment

  • Version used: 1.4.3
  • Compiled from source or NuGet package?: NuGet
  • Payload/Encoded text:
  • Used payload generator:
  • Used ECC-level:
  • Used renderer class:
  • Environment (.NET 3.5, .NET 4.X, .NETCore, …): .NET 6.0 –>

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:22
  • Comments:25

github_iconTop GitHub Comments

2reactions
danielgindicommented, Aug 4, 2022

You can enable System.Drawing for .NET 6. It’s disabled by default because some features are not available cross-platform, but this library does not use any of those.

2reactions
onatskocommented, Apr 18, 2022

all works fine with version Include=“QRCoder” Version=“1.4.1”

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET 6.0 upgrade gives System.TypeLoadException Could ...
I have a project which is currently running in .NET 5.0. It is written using C#. I installed .NET SDK 6.0.201 in my...
Read more >
NET 6.0 upgrade gives System.TypeLoadException
net framework, due to some requirement one component we have migrated to .net 6 , then during instalation of artifacts I am getting...
Read more >
Could not load type 'Microsoft.AspNetCore.Mvc.Internal. ...
NET Core 3.1 to .NET 6.0. After upgrade of project along with ... TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.
Read more >
TypeLoadException Class (System)
TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.
Read more >
TypeLoadException after upgrade to 6.3.0
Hello, After upgrading my .NET 6.0 project from using ServiceStack 6.1.0 to 6.3.0 (from nuget.org), I am encountering the following ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found