Unity3D Wrapper Conflict.
This issue is due to conflicting types between two different assemblies in your project: 'System.Interactive.Async' and 'netstandard'. They both have a definition for 'IAsyncEnumerable' which is causing the error.
To fix this, you might need to exclude one of the conflicting types from being used. The most straightforward way to do this is probably to add an extern alias to one of the conflicting assemblies, and then use that alias whenever you're referring to types from that assembly. Here's how you can do this:
Add an extern alias to the conflicting assembly
In the case of .NET Core or .NET 5+ projects, you can do this by editing the project file (.csproj).
You can right click on your project in Visual Studio > select Edit Project File, and then add an
Aliasesattribute to thePackageReferencethat's causing the conflict.Your
PackageReferencemight look something like this:xml<PackageReference Include="System.Interactive.Async" Version="3.0.1000.0"> <Aliases>MyAlias</Aliases> </PackageReference>This effectively gives the
System.Interactive.Asyncassembly a new alias that can be used to refer to its types.Use the alias when referring to conflicting types
Now, in your code files, you can use the
extern aliasdirective at the top of your file to import the conflicting assembly under its new alias:csharpextern alias MyAlias;And then, whenever you want to refer to a type from
System.Interactive.Async(likeIAsyncEnumerable), you can use the alias:csharpMyAlias::System.Collections.Generic.IAsyncEnumerable<MyType>
However, if you're not sure how to proceed or this doesn't work, I'd recommend reaching out to the author of the library you're trying to use or asking on a community forum like StackOverflow. The specific details of the solution might change depending on the specifics of your situation.