PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
MIT License
274 stars 52 forks source link

"Error CS0518: Predefined type 'System.IAsyncDisposable' is not defined or imported" if project contains Microsoft.Bcl.AsyncInterfaces.dll #609

Closed PetrBodnar closed 4 months ago

PetrBodnar commented 4 months ago

Describe the bug If project contains Microsoft.Bcl.AsyncInterfaces.dll than compile error occurs Library/PackageCache/com.playeveryware.eos@024a48d770/Runtime/Core/Config.cs(156,13): error CS0518: Predefined type 'System.IAsyncDisposable' is not defined or imported

Desktop (please complete the following information): Mac OS 14.1.1 (23B81) Editor Unity 2021.3.14f1 eos_plugin_for_unity v3.1.0

Additional context We have a code that relies on Microsoft.Bcl.AsyncInterfaces.dll that we cant remove due to business reasons. We tried to remove Microsoft.Bcl.AsyncInterfaces.dll and code that uses it (as an experiment), and project compiles without issues.

andrew-hirata-playeveryware commented 4 months ago

Hello @PetrBodnar,

I'm not entirely familiar with Microsoft.Bcl.AsyncInterfaces.dll and how it works; how did you install it?

If I were to make a guess on how to work around this issue, I would say that creating a directory in your asset folder, along with an asmref to our plugin, you should be able to define a "fake" version of the Interface, and that might work. This is a guess though, because I don't know how you have things configured.

As another work around, you could also install the plugin as a UPM that you decompress outside of the Assets directory, then do any modifications needed.

PetrBodnar commented 4 months ago

I'm not entirely familiar with Microsoft.Bcl.AsyncInterfaces.dll and how it works; how did you install it?

It's installed as part of third-party plugin, at path Assets/ThirdPartyPlugin/Plugins/Microsoft.Bcl.AsyncInterfaces.dll with following settings: Снимок экрана 2024-04-19 в 10 28 59

Thank you, I think we will try:

andrew-hirata-playeveryware commented 4 months ago

Sounds good!

I'm going to close this issue then: if you find a solution that works I'd be willing to look at a PR to see if it's possible to incorporate it into out Plugin so that others don't stumble on a similar issue.

As a last 'hint', now that I can see the Microsoft.Bcl.AsyncInterfaces.dll is being auto reference, I'm betting that's the issue, as that will force it to be added to all assemblies, even if we don't have support for that feature.

Good luck!