Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve nuget DLL hell after upgrading to ASP.NET MVC 5 and Web API 2

I have upgraded ASP.NET MVC4 to ASP.NET MVC 5.1 following these steps from this WebSite

I get stuck on upgrading nuget packages, there are plenty of errors and rollsback:

for example

Install failed. Rolling back...
Install-Package : Updating 'Microsoft.AspNet.WebApi.Core 4.0.20710.0' to 
'Microsoft.AspNet.WebApi.Core 5.1.0' failed. Unable to find a version of 
'Microsoft.AspNet.WebApi.OData' that is compatible with 'Microsoft.AspNet.
WebApi.Core 5.1.0'.

or

Update-Package : Updating 'Microsoft.Net.Http 2.0.20710.0' 
to 'Microsoft.Net.Http 2.2.18' failed. Unable to find versions of 
'Microsoft.AspNet.WebApi.Client, Microsoft.AspNet.WebApi.OData' that 
are compatible with 'Microsoft.Net.Http 2.2.18'.

Is there some easy step to clean and update all and to get rid of this DLL hell?

like image 415
Tomas Kubes Avatar asked Jan 25 '14 14:01

Tomas Kubes


1 Answers

A quick way to delete all the nuget packages in your project is to manually edit the packages.config file, then delete all the dll references (Only for the dlls in the nuget packages).

This takes a lot less time than uninstalling then all via nuget package manager, especially when there is such a large dependency tree.

like image 50
Tom Webster Avatar answered Oct 28 '22 17:10

Tom Webster