VS2017 .NetCore 2.0 API - Could not load file or assembly Microsoft.AspNetCore.Hosting.Abstractions
Solution 1
I had the same error attempting to debug a simple Azure Function App (this is using .NET core) created from the Function App template in Visual Studio 2017. Attempting to run in debugger gave me the same error. It turned out to be I had updated the Microsoft.NET.Sdk.Functions package from version 1.0.6 to 1.0.12. That was my problem. Reverted the update back to 1.0.6 and it worked fine. Hope this helps!
Solution 2
Please re-install the nuget package or upgrade to the latest at: https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.Abstractions/
Dries
Updated on June 28, 2022Comments
-
Dries almost 2 years
I've just created a new API using ASP.NET Core 2.0. I haven't coded anything yet. I just want to test the initial API template.
When I try to start my project I receive the following error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Could not load file or assembly 'Microsoft.AspNetCore.Hosting.Abstractions, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
I do not receive any errors when building the project. The assemby can be found at the following directory: 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.hosting.abstractions\2.0.2'.
Is that correct? Where should the 'Microsoft.AspNetCore.Hosting.Abstractions' assembly be located and why can't VS find it?
-
baduker about 6 yearsLinks to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
-
Dries about 6 yearsOmg, I spent several hours looking for a solution. This actually worked! Thank you!
-
Dries about 6 yearsYour suggestion was the first thing I've tried but it did not resolve the problem unfortunately.
-
Benjineer almost 5 years@baduker the link works fine for me. Also, the answer describes what the link is - "the nuget package".