Part of 100% perfect-working code from regular Visual Studio C# project.
“Dictionary” reference to System.Collections.Generic namespace from System.Collections dll with 638 lines of code…
And the same code, in Unity C# script, with error:
CS1503 Argument „1”: cannot convert from
„System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<T, System.Collections.Generic.HashSet>>”
to
„System.Collections.Generic.IDictionary<T, System.Collections.Generic.HashSet>”
“Dictionary” reference to System.Collections.Generic namespace from netstandard dll with 81 lines of code…
Is it possible to change somehow Unity settings, to force it to use same dll’s as VS and run my code properly?
What target framework is your project in Visual Studio targeting? That constructor isn’t part of .NET Standard 2.0 I believe (and Unity targets .NET Standard 2.0 when building your code by default).
Yeah so Unity doesn’t support those targets. To match Unity, you either need to compile for .NET Framework 4.7.1, or for .NET Standard in Visual Studio (depending on whether you target .NET 4.x or .NET Standard 2.0 in your Unity settings).
Thank You,
So… it means Unity won’t support my code whatever I change in settings, unless I change the code, to works good in VS in:
a) WindowsFormsApp (.NET Framework 4.7.1 & Unity settings on .NET 4.x), or
b) C# ClassLibrary (.NET Standard & Unity settings on .NET Standard 2.0),
right?