Open farzadi opened 7 years ago
same error with websocket4net.dll :
I am using it together with the oculus plugin "Oculus integration" and the error appears in System.Func...Any Solution? Thank you
Hm, running into this too, conflicting with mscorlib:
error CS0433: The type 'Action<T1, T2, T3>' exists in both 'WebSocket4Net, Version=0.14.1.0, Culture=neutral, PublicKeyToken=eb4e154b696bf72a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
No solutions for this???
For me, the issue I had was I was somewhere in my code or a framework I was using, I had my own enum or class that was also called Action, and in the same namespace. I think moving it into a different namespace helped me.
This link is to .NET 2.0 versions of the libraries for WebSocket4Net that will both work in Unity and won't cause problems with non-2.0 features such as Func, Action and Linq.
https://drive.google.com/drive/folders/1p0MRrFCdbWM4oCNTv_wGvcRQ_PlZpnlP?usp=sharing
Is there a solution, can't still find one ? Should we do something to remove the Func in the package manager, instead of the dll ?
The new versions of Unity (2018.4+) allow you to use .NET Standard 2 and .NET 4.x as your scripting backend. This means that you can use the much later versions of your libraries, so that this problem doesn't occur.
Alternatively, you need to do what I did for WebSocket4Net, and go into the code. If you search for the definition of 'func' and rename it to something else, you'll remove the problem.
It's caused by the fact that quite a few libraries use LINQ-style code techniques, and then define those types (like Action and Func) themselves so that they compile in .NET 2. If you remove those definitions, it should work.
@OptrixAU Sorry, so if I understand you, the WebSocket4Net you uploaded above (23 aug) is already corrected to remove the "func" ? Are the two others dlls in the drive required ?
Since I never edited a dll, i tryied yours and have others errors instead, like:
"C:\Program Files\Unity\Hub\Editor\2019.2.9f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\RectMask2D.cs(197,51): error CS1579: foreach statement cannot operate on variables of type 'HashSet
May you help me, thx
I have errors in some of my packages. Is this error under test and resolving? if yes, please let me know how long it takes to be resolved and help me solve the problem temporarily. The packages that had conflict in my project were NGUI and UnityMainThreadDispatcher.
and