unity disable nuget.immutable?

hello.

before i start.

  • am using unity for game developement

  • writing code in c#

  • using visual studio to write codes

i have just installed NUget.immutable collection package.

i want to use system.collection.immutable
but whenever i open unity editor it throws an error “namespace name immutable cannot be found”.

  • this error is not present if i open my script independently just using visual studio

  • tried reinstalling nuget.collection.immutable didnot fix the problem.

  • tried reinstalling visual studio/ unity also did not fix the problem.

i have no idea what is causing this problem.

ive searched in multiple forums but did not find any answer.

so, has anyone faced this problem or know the solution to fix this?

thank you in advance:)

Edit;

after some research, i managed to pin point what seems to cause the problem. but i cannot fix it

i noticed that when my script to unity editor, the assembly reference to system.collection.immutable

disappear. i have no idea what is causing this. i need help please!

Hi @VadDivine,
I too did strugle with this very problem, until I found this article:

Here it is explained what steps must be taken in order to properly install a package from NuGet for usage within the context of unity. The problem that you’re facing is that unity reloads the project configurations in Visual Studio, undoing the configurations made during the installation process of the package through Visual Studio. In order to avoid this, the package must be added in a folder within the unity assets folder called plugins. That said, the article above undoubtedly describes this better then I do ;-).
(By the way, don’t forget to install all packages listed in Dependencies, it took me 5 packages in total to instal)