itisnajim / SocketIOUnity

A Wrapper for socket.io-client-csharp to work with Unity.
MIT License
379 stars 65 forks source link

error CS0012: The type 'ReadOnlyMemory<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. #69

Open sunlighing opened 9 months ago

sunlighing commented 9 months ago

when i import this package ,but have follows error

sunlighing commented 9 months ago

image

sunlighing commented 9 months ago

unity version 2020.3.39 ,socketio 1.14

strobert22 commented 7 months ago

Hi @sunlighing

im using unity 2020.3.46f1 same problem here.

(disclaimer: i dont know what im doing) im try adding "System.Memory.dll" on file itisnajim.SocketIOUnity.asmdef

like this { "name": "SocketIOUnityAssembly", "rootNamespace": "", "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": true, "precompiledReferences": [ "Microsoft.Bcl.AsyncInterfaces.dll", "Newtonsoft.Json.dll", "System.Reactive.dll", "System.Memory.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Text.Json.dll", "System.Text.Encodings.Web.dll" ], "autoReferenced": true, "defineConstraints": [], "versionDefines": [], "noEngineReferences": false } then Go to Project View, right-click on foldier Packages/Unity SockerIO and press "reimport"

now I don't have any errors and everything seems to compile fine but when I try to use the SocketUIClient I get it that the namespace dont exist.

im keep trying.

TiagoAndreAlmeida commented 5 months ago

Any update on this ?

LabGuy94 commented 3 months ago

Having the same issue on 2019.4.39f

Thomasdfoz commented 1 month ago

To fix the error, just edit itisnajim.SocketIOUnity.asmdef and add this library

{ "name": "SocketIOUnityAssembly", "rootNamespace": "", "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": true, "precompiledReferences": [ "Microsoft.Bcl.AsyncInterfaces.dll", "Newtonsoft.Json.dll", "System.Reactive.dll", "System.Runtime.CompilerServices.Unsafe.dll", "System.Text.Json.dll", "System.Text.Encodings.Web.dll", "System.Memory.dll"

],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false

}