Cysharp / R3

The new future of dotnet/reactive and UniRx.
MIT License
1.72k stars 70 forks source link

SystemRuntime.CompilerServices.Unsafe missing #142

Closed tattyd closed 4 months ago

tattyd commented 4 months ago

Hello again,

Steps:

  1. Installed R3 via NuGet for Unity
  2. Installed R3 via Unity Package manager and Git URL
  3. Errors in console:
Assembly 'Assets/Packages/R3.1.0.4/lib/netstandard2.0/R3.dll' will not be loaded due to errors:
Unable to resolve reference 'System.Runtime.CompilerServices.Unsafe'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

From some research it looks like you may have had similar issues in the past (https://github.com/MessagePack-CSharp/MessagePack-CSharp/issues/716) , so I'm filing an issue to see if you have any specific advice.

When installing from NuGetForUnity, I see this message from NuGetForUnity in the Console:

Package System.Runtime.CompilerServices.Unsafe.6.0.0 is already imported in engine, skipping install.

Which implies NuGet thinks the correct version (6.0.0) is already available - but the Unity engine disagrees.

Thank you, David

neuecc commented 4 months ago

what is the Unity version and api compatibility level?

tattyd commented 4 months ago

Hi there,

Unity 2023.2.11f1, .NET Standard 2.1

neuecc commented 4 months ago

Are you installing other packages? If so, please list the names of those packages.

tattyd commented 4 months ago

Hello!

From Unity Package manager:

From Unity:

From NuGet for Unity:

neuecc commented 4 months ago

If no packages have been installed, there probably won't be any issues. Could you investigate which package is causing the conflict? That way, we might be able to think of a solution.

tattyd commented 4 months ago

I can try - do you have any advice on how to do that, apart from removing all packages and adding one by one?

neuecc commented 4 months ago

I don't know, do removing all packages and adding one by one.

tattyd commented 4 months ago

Just an update here:

I was able to start again with a blank project, copy in my packages.json and get System.CompilerServices.Unsafe installed that time.

However, in my actual game project it still refuses to install.

So far I've tried:

I think it may be a bug in NuGet for Unity, so I'll file a bug there. Thanks!