sta / sta/websocket-sharp

When using Unity, gives "System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded." error.

Open
#320 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hello. When I put websocketsharp.dll into my Unity project, I get this error.

Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0

Missing method .ctor in assembly /media/boyned/ExtraSpace/BattleHatsCCG/Battle Hats CCG/Assets/Plugins/websocket-sharp.dll, type System.Runtime.CompilerServices.ExtensionAttribute
The class System.Runtime.CompilerServices.ExtensionAttribute could not be loaded, used in websocket-sharp
Can't find custom attr constructor image: /media/boyned/ExtraSpace/BattleHatsCCG/Battle Hats CCG/Assets/Plugins/websocket-sharp.dll mtoken: 0x0a000001

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by placing websocket-sharp.dll in the Unity project's Assets/Plugins directory, then start with the ReflectionTypeLoadException and the reported ExtensionAttribute loader error. Done means Unity can load the assembly without the reported compiler and type-loading errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.