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

Cannot install System.Collections.Immutable: Install Button does nothing? #401

Closed
XDracam opened this issue Jun 14, 2021 · 12 comments
Closed

Comments

@XDracam
Copy link

XDracam commented Jun 14, 2021

Description

Originally installed: System.Collections.Immutable 1.7.2 through plugin version 2.0.3 (I think)

Updated package. Clicked "Install All Updates". Worked fine for all packages but that one. For some reason, whenever I click the "Install" button, nothing happens. Of course, the code stopped compiling, as it can't find the immutable collections anymore.

Running the debugger with a breakpoint on any exception reveals this in NugetPackage.cs:

image

  • NuGet Package: System.Collections.Immutable 5.0.0
  • NuGetForUnity Version: 3.0.2
  • Unity Version: 2020.2.2f1
  • Operating System: Windows 10
@XDracam
Copy link
Author

XDracam commented Jun 14, 2021

Stack trace of exception, copied from debugger:

  at System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureParameter) [0x0001c] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00059] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00010] in <9577ac7a62ef43179789031239ba8798>:0 
  at NugetForUnity.NugetPackage.FromNuspec (NugetForUnity.NuspecFile nuspec) [0x0009c] in <ee6cbe4822d046d98553a66d7fbaadcd>:0 

Indeed, nuspec.RepositoryType is null for some reason.

@slimshader
Copy link

Same error here. Enabling verbose logging says Package is already installed and nothing happens.

@AndreiaSaria
Copy link

The same happened here with System.Threading.Tasks.Extensions.

@DanielW093
Copy link

I've just come across the same issue - any solutions?

@XDracam
Copy link
Author

XDracam commented Nov 28, 2021

I've just come across the same issue - any solutions?

The same solution for everything that doesn't work with this plugin: Install the dependency in some other project, manually copy around dlls of the dependency and its dependencies and then hope that unity doesn't complain. Get desperate, manually guess which boxes need to be ticked in the inspector, and at some point it might just work. At least that's how I eventually did it...

@jhughes2112
Copy link

The simplest answer is to add a text file called Assets\csc.rsp and put -r:System.ServiceModel.dll in it. Or whatever assembly you need.

@bawahakim
Copy link

Same issue on my side. I tried @jhughes2112 solution but doesn't seem to work for me. There is one workaround I found following this:

https://docs.microsoft.com/en-us/visualstudio/gamedev/unity/unity-scripting-upgrade

Basically:

  1. Go to the target package: https://www.nuget.org/packages/System.Collections.Immutable/
  2. Download package
  3. Change extension to .zip and extract
  4. Find the dll file under lib/netstandard2.0
  5. Extract to Plugins
  6. Repeat for every dependency of that package (yes, incredibly tedious and inefficient)

Works, but ended up not using the Immutables at that point. Could be useful for a critical package.

@jhughes2112
Copy link

Yes, @bawahakim describes the technique I use now for most dependencies. I stopped using NuGet because I needed to break apart a package and explicitly manage some dependency version numbers, and NuGet didn't let me do that. Be aware, though, that if a package requires specific versions of a .dll, Unity will throw a fit if you call a function that is from that package and you have the wrong version (or no version) in the plugins folder, because it fails to load the Assembly, and throws an exception instead. This won't be apparent until you hit one of those functions at runtime. So be thorough.

@IvanMurzak
Copy link

The issue still exists. I like NuGetForUnity. Does it possible to fix it? It is so annoying to import DLLs manually :(

@yangchos
Copy link

yangchos commented Mar 3, 2023

same issue with

NuGet Package: System.IdentityModel.Tokens.Jwt
NuGetForUnity Version: 3.1
Unity Version: 2021.3.19f1
Operating System: Windows 10

@JoC0de
Copy link
Collaborator

JoC0de commented Mar 4, 2023

Sorry for the delay. But there was a time with nearly no active contributors...
I tested installing System.Collections.Immutable with version 3.1.0 and it works fine, there are many changes from 3.0.5 to 3.1.0 that should have fixed it.
I also tested System.IdentityModel.Tokens.Jwt but got some compiler error that the Microsoft.CSharp assembly is installed twice. I fixed it in #502 at leas on my machine it worked after the change. @yangchos If you still have problems pleas provide the logs produced wen enabling Verbose logging and the information what ApiCompatibilityLevel you are using (.Net Standard or .Net Framework).

@yangchos
Copy link

yangchos commented Mar 13, 2023 via email

@JoC0de JoC0de closed this as completed Mar 14, 2023
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

9 participants