i was wondering , can i add a 3.5 Dll to unity project that it’s configured as .Net Standard ?
i’ve created a unity Project , set it to be:
.Net 4.X Equivalent
IL2CPP
.NET Standard 2.0
in my code I’ve referenced the newtonsoft json library , but i accidentally copied the 3.5 version to Uinty Asset folder , it complied and add the references ,
i’ve replaced it with the 4.5 version, it compiled ok , no matter what version of the Dll i use , unity is ok with it.
any explanation?
Yes, this is possible. When the .NET Standard 2.0 Api Compatibility Level is used, Unity passes the C# compiler all of the reference assemblies for the .NET Framework 4.7.1 API. So it is possible to use an assembly compiled against .NET 4.5 or .NET 3.5. (since .NET 3.5 is a proper subset of .NET 4.5).
Note that it is possible that the implementation of the .NET Standard 2.0 class libraries Unity ships with won’t support something the assembly built against .NET 4.5 uses, but we won’t know that until run time.
1 Like
That goes as will if i used a .net Core Dll ?