GlitchEnzo / NuGetForUnity

A NuGet Package Manager for Unity
MIT License
3.14k stars 310 forks source link

Installing a package with with a version lower but compatible with the .NET version of the project is impossible #553

Open jborlido opened 1 year ago

jborlido commented 1 year ago

Description

The problem is that when I try to install a NuGet package that has a DLL which is compatible with the .NET version of my Unity project but lower than that same version, it does not keep it in the project. I had to manually download and install this NuGet package on my project. It would be nice if versions lower but compatible could be downloaded and kept as well.

igor84 commented 1 year ago

That package seems to only have an implementation DLL for net40 and not for netstandard so in order to use it you would need to set your Unity project to use .NET Framework instead of .NETStandard in project settings and then the package will properly install.

jborlido commented 1 year ago

The .NETStandard package I'm using does contain a dll for .NET 2.0 because I had to download manually and install it on my project. Changing the .NET version of my project is not an option.

popara96 commented 1 year ago

.NETStandard 2.0 dll is in the ref folder which is reserved for referenced libraries afaik. NuGet for Unity looks for dlls inside lib folder, and Mono.Posix.NETStandard 1.0.0 package only has net40 folder inside lib, which is rendered as incompatible. It might not need .NETFramework functionalities for everything so some things might work, but some you might discover won't work only in the build. That is why NuGet for Unity can't just accept installing packages like this.

JoC0de commented 1 year ago

Can't you just uses Mono.Posix this has a dll for netstandard 2.0

jborlido commented 1 year ago

I tried that as well, didn't work out

popara96 commented 1 year ago

@JoC0de that package is shown only if Show Prerelease is checked (@jborlido FYI). It seems to not delete its netstandard2.1 folder when I install it in Unity 2021.3.12f1 (similarly it leaves netstandard2.0 folder in 2018.4.36f1) from lib in my case, which should be its expected behaviour. Although it does show some errors when installed (note that the error occured only in Unity 2021 and not in 2018 when I tested it). Screenshot attached. image

JoC0de commented 1 year ago

@jborlido can you explain why you even need the package? For me the package sent to not contain functionally that is not already in unity. @popara96 ok this is strange i need to have a look

jborlido commented 1 year ago

This is a dependency of another private package I'm using on my project.

JoC0de commented 1 year ago

Ok I looked at it the package is relay strange: