Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuGet Clone failure in Unity With dotnet 4.8.1 #153

Closed
Reag opened this issue Feb 25, 2024 · 5 comments
Closed

NuGet Clone failure in Unity With dotnet 4.8.1 #153

Reag opened this issue Feb 25, 2024 · 5 comments

Comments

@Reag
Copy link

Reag commented Feb 25, 2024

Currently, if you follow the install instructions for Unity (2022.3.x) project set to .Net Standard 2.1, it will function as expected.

However, if you have the project set to .Net Framework, the ZLogger NuGet is configured to deliver an incorrect version of the Microsoft.Bcl.AsyncInterfaces. This leads to a compile error, as the ZLoggerUnityDebugLoggerProvider cannot compile, as the interface IAsyncDisposable is in both Microsoft.Bcl.AsyncInterfaces and mscorlib (System).

There is a work around, setting your project temporarily to .Net Standard 2.1 then doing the NuGet Restore, but this will cause huge problems in automated pipelines

@neuecc
Copy link
Member

neuecc commented Feb 25, 2024

Thank you. Due to the somewhat special of Unity's .NET Framework and .NET Standard 2.1, there can be inconsistencies with definitions on NuGet.
Does this issue with NuGetForUnity match what you're referring to?
GlitchEnzo/NuGetForUnity#621
Please give a +1(and comment) to this, or it might be necessary to open a new issue.

@Reag
Copy link
Author

Reag commented Feb 26, 2024

That appears to be the cause, yes.

[edit]: It might be a good idea to provide an optional UPM git url for the NuGet dependencies for the ZLogger in Unity. Perhaps a small repo that just contains the required DLLs for the ZLogger's Unity implementation. That way, a user could get the package without having to deal with the frankly annoying process of trying to use NuGet for Unity. Its more work, but it would allow you to have full control of the DLLs and their delivery. Plus, its always good to have options that don't involve a 3rd party package manager

@neuecc
Copy link
Member

neuecc commented Feb 26, 2024

In the future, we intend to move Cysharp's extensive library of dependent DLLs to the NuGet base.
Providing our own resolution DLLs would undermine such global dependency resolution.
There are various approaches such as OpenUPM and UnityNuGet (not NuGetForUnity), but I believe that the official Microsoft NuGet is the best registry for non-Unity dependent packages.

@neuecc neuecc closed this as completed Feb 26, 2024
@Reag
Copy link
Author

Reag commented Mar 4, 2024

Would it be possible for you to add the full ZLogger, along with dependencies, to UnityNuGet? From what I've read, you would have to make a PR with references to the dependencies. As it stands right now, I have to manually add all the DLLs to my repo in order for my automated build pipeline to work correctly. If I had an alternative, that would be amazing, as I could use NuGet as its intended to be used.

Apologies for bumping this dead issue, as I'm sure there are far more important and interesting things to be working on.

@neuecc
Copy link
Member

neuecc commented Mar 4, 2024

I believe it's better to have a single registry, and NuGetForUnity is what makes that possible in Unity, which is why I support it. Of course, I'm not against trying to register with other registries (though I'm not fond of OpenUPM, I won't refuse to be registered there, also UnityNuGet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants