ProtoPromise icon indicating copy to clipboard operation
ProtoPromise copied to clipboard

Compilation error if to use it together with plugin for "oidc-client" (needed for Azure auth)

Open IvanMurzak opened this issue 1 year ago • 8 comments

That is the conflict with Microsoft.Bcl.AsyncInterfaces.dll, which is part of the Oidc-Client.

Library\PackageCache\[email protected]\Core\Cancelations\CancelationRegistration.cs(117,46): error CS0433: The type 'IAsyncDisposable' exists in both 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Unity version 2022.3.11.

Is there any way to avoid the conflict? I can't disable/remove the DLL because the plugin needs other classes from it. PhotoPromise looks very impressive, I would like to try it if only it could life together with that dll.

image

IvanMurzak avatar Apr 20 '24 01:04 IvanMurzak

@IvanMurzak What types from that dll are not included in .Net Standard 2.1? ProtoPromise uses the types from the standard BCL. Typically libraries like that that have types from the BCL automatically work in non-Unity, so it might be a Unity-specific bug.

timcassell avatar Apr 20 '24 02:04 timcassell

@IvanMurzak I assume you are trying to use this with https://www.nuget.org/packages/IdentityModel.OidcClient? I tried with Unity 2022.3.21 using https://github.com/GlitchEnzo/NuGetForUnity, and I didn't see any errors. Maybe you need to update your Unity version?

timcassell avatar Apr 20 '24 02:04 timcassell

@IvanMurzak What types from that dll are not included in .Net Standard 2.1? ProtoPromise uses the types from the standard BCL. Typically libraries like that that have types from the BCL automatically work in non-Unity, so it might be a Unity-specific bug.

The project I am working on has .NET Framework 4.x. Is the .NET Standard 2.1 required to use ProtoPromise ?

IvanMurzak avatar Apr 24 '24 03:04 IvanMurzak

The project I am working on has .NET Framework 4.x. Is the .NET Standard 2.1 required to use PhotoPromise ?

Unity's 4.X API compatibility level includes .Net Standard 2.1 APIs (unlike desktop Framework). So, no, netstandard2.1 API compatibility level is not required to use ProtoPromise, but you may need to update your Unity version to get it to work (have you tried that yet?).

timcassell avatar Apr 24 '24 03:04 timcassell

The project I am working on has .NET Framework 4.x. Is the .NET Standard 2.1 required to use ProtoPromise ?

Unity's 4.X API compatibility level includes .Net Standard 2.1 APIs (unlike desktop Framework). So, no, netstandard2.1 API compatibility level is not required to use ProtoPromise, but you may need to update your Unity version to get it to work (have you tried that yet?).

Sorry, that is too risky to update Unity version. I won't do that. I can just try to do that with a copy of the project just to let you know if that works. But it won't be a solution for me.

IvanMurzak avatar Apr 24 '24 03:04 IvanMurzak

@IvanMurzak I tried again using Unity 2022.3.11, with .Net Framework API compatibility level. I'm not seeing any errors with only OidcClient and ProtoPromise installed. Are you able to repro in a separate project with just those 2 libraries? Maybe something else is causing the issue. If so, can you share the steps you are using to install the libraries?

timcassell avatar Apr 24 '24 04:04 timcassell

Just tried to update Unity for 2022.3.25. Still have all the errors.

image

IvanMurzak avatar Apr 24 '24 16:04 IvanMurzak

@IvanMurzak I tried again using Unity 2022.3.11, with .Net Framework API compatibility level. I'm not seeing any errors with only OidcClient and ProtoPromise installed. Are you able to repro in a separate project with just those 2 libraries? Maybe something else is causing the issue. If so, can you share the steps you are using to install the libraries?

I will try to reinstall OidcClient. I will reply later

IvanMurzak avatar Apr 24 '24 16:04 IvanMurzak

Closing for no repro. I also think it's not an issue with this library.

timcassell avatar May 21 '24 08:05 timcassell