Search code examples
.netvisual-studio-2017nugetout-of-memoryassembly-binding-redirect

How to solve OutOfMemoryException errors when adding a new NuGet package?


Similar to this question, I'm getting an exception in the Package Manager Output window while adding a new NuGet package (System.Collections.Immutable):

Failed to update binding redirects for MyProject.csproj : Exception of type 'System.OutOfMemoryException' was thrown.

While I find many results for NullReferenceException errors, I found none for my OutOfMemoryException.

My question:

How to solve OutOfMemoryException errors when adding a new NuGet package to a project?


Solution

  • My solution was:

    1. Exit Visual Studio.
    2. Start Visual Studio again.
    3. Uninstall the package.
    4. Install the package again.

    After that, no exception was shown in the Package Manager Output window.

    I still do have no binding redirects for the package, but maybe it is not required at all.