Real-Serious-Games / C-Sharp-Promise

Promises library for C# for management of asynchronous operations.
MIT License
1.19k stars 149 forks source link

Support .NET Standard and 3.5 into the same Unity project #90

Closed jdnichollsc closed 5 years ago

jdnichollsc commented 5 years ago

Hi guys, Some Unity users have reported the same issue with the RSG.Promise library:

So, my question is... Is there an easy way to support the two frameworks? (Depending on the selected platform, the respective DLL is loaded to avoid duplicate reference errors) Honestly, I don't know, I don't have a lot of experience with Unity.

This is the plugin from the Unity Store https://assetstore.unity.com/packages/tools/network/rest-client-for-unity-102501

Any recommendation is very appreciated 👍

RoryDungan commented 5 years ago

The easiest way to fix this would probably be to just include the source for C# Promise instead of the compiled DLL. If you have to only ship one version of the DLL I'd probably suggest still using the .NET 3.5 version because that will work with older .NET 3.5 projects as well as ones targeting the full .NET 4.x framework. It just won't support .NET Standard or UWP projects.

I had a quick look online and in Unity and it doesn't look like there's a way built-in to enable or disable DLLs depending on the .NET runtime.