I'm receiving the following warning on my ASP.NET Core 2.1 MVC project.
C:\Program Files\dotnet\sdk\2.2.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of
2.1.7
. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs
It appears to be referencing this line in my .csproj
file:
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.7" />
If I remove the version from the PackageReference the warning goes away, but then I get this error when I try to start my project:
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at MyProject.Web.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
I'm not sure where Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0
is even coming from. Anyone else run into the same problem?
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3" />
– Craig Selbert.csproj
file code. I am telling you what the problem exactly is! – TanvirArjel