Reputation: 2917
I just upgraded an MVC project from .NET 4.0 to 4.5 and I'm getting some errors when trying to build.
I have no idea where to start debugging this, so any pointers in the right direction would be appreciated. Or a solution, of course.
Multiple assemblies with equivalent identity have been imported: 'C:[PATH]\packages\Microsoft.Bcl.1.1.10\lib\net40\System.IO.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades\System.IO.dll'. Remove one of the duplicate references. [projectname] C:[PATH][PROJECTNAME]\CSC
Multiple assemblies with equivalent identity have been imported: 'C:[PATH]\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Runtime.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades\System.Runtime.dll'. Remove one of the duplicate references. [projectname] C:[PATH][PROJECTNAME]\CSC
Multiple assemblies with equivalent identity have been imported: 'C:[PATH]\packages\Microsoft.Bcl.1.1.10\lib\net40\System.Threading.Tasks.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades\System.Threading.Tasks.dll'. Remove one of the duplicate references. [projectname] C:[PATH][PROJECTNAME]\CSC
What I've Tried
When I googled the error, this often seemed to be mentioned in relation to EF, so I tried uniinstalling that, and undating to the latest version, but this didn't have any noticable effect.
I also tried updating a bunch of nuget packages to the latest versions, but again, this didn't seem to have any noticable effect.
I have also tried uninstalling Microsoft.Bcl, but it won't let me because:
Unable to uninstall 'Microsoft.Bcl.1.1.10' because 'Microsoft.Net.Http.2.2.29' depends on it.
Finally, it seems related to this question, but there is no answer there, and TBH even the question is slightly over my head!
Update
I read this (recommended uninstalling and reinstalling Bcl packages).
I unistalled Microsoft.Net.Http.2.2.29
and the bcl packages. The project built, but when running it locally I got:
Could not load file or assembly 'System.Web.Helpers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
So I reinstalled them. But now I'm still getting the same error message!
I installed System-Web-Helpers.dll
to no effect.
Upvotes: 3
Views: 2683
Reputation: 214
I have been struggling for a day with this problem. Reinstalling the bcl nuget package did not help i got the same error
The solution was to unload the project open the csproj file and remove the references by hand (remove all three packages):
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.14-rc\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
You also need to reinstall them. This step is only if the build doesen't work after package reinstallation
Upvotes: 1