Hi Guys,
I running project with command line "dotnet run" it's throw error and I don't know why please let's me know how to resolve this problem, thanks
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl
y 'Microsoft.Extensions.Primitives, Version=1.1.0.0, Culture=neutral, PublicKeyT
oken=adb9793829ddae60' or one of its dependencies. The located assembly's manife
st definition does not match the assembly reference. (Exception from HRESULT: 0x
80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.Primitives, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a
db9793829ddae60' or one of its dependencies. The located assembly's manifest def
inition does not match the assembly reference. (Exception from HRESULT: 0x801310
40)
--- End of inner exception stack trace ---
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.AspNetCore.Hosting.WebHostBuilder..ctor()
at WBS.BackEnd.Program.Main(String[] args) in D:\1.Coding\StartUp\WBS\3. Sour
ce Code\WBS.Solution\src\WBS.BackEnd\Program.cs:line 10
dotnet --info
output:
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e
Runtime Environment:
OS Name: Windows
OS Version: 6.2.9200
OS Platform: Windows
RID: win8-x64
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"MongoDB.Driver": "2.2.4",
"AngularJS.Animate": "1.5.5",
"WBS.Common": "1.0.0-_",
"WBS.Entities": "1.0.0-_",
"WBS.Service": "1.0.0-*",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final",
"Microsoft.Extensions.DependencyInjection": "1.0.0-rc2-final",
"System.IdentityModel.Tokens": "5.0.0-rc1-211161024",
"System.IdentityModel.Tokens.Jwt": "5.0.0-rc2-305061149",
"Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-beta8",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Cors": "1.0.0-rc2-final",
"Microsoft.Owin.Security.Jwt": "3.0.1",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-final"
},
It looks like you're using mostly RC2 libraries, could you try upgrading all your dependencies to release versions?
If a library does not have a release version (like Microsoft.Framework.DependencyInjection.Abstractions
), I think that means the library got renamed (in this case, to Microsoft.Extensions.DependencyInjection.Abstractions
) and you should use the renamed library instead.
Hi svick
I deleted folder bin, obj and restart my computer, it's working ok now, I don't know why occur problem
Thank you for your help
Glad this got resolved :smile:
Please reopen if you hit this issue again.
deleting bin. helped me as well
Yes, deleting the bin folder fixed the issue. Thanks for sharing
I get the same error when using services.AddSignalR();
I have no idea why, and by deleting bin and obj folders I still have the same error.
full error description :
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.Options, Version=1.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.Extensions.DependencyInjection.SignalRDependencyInjectionExtensions.AddSignalR(IServiceCollection services)
at signalR_test.Startup.ConfigureServices(IServiceCollection services) in c:\Users\s.ganji\Desktop\signalR_test\Startup.cs:line 34
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at signalR_test.Program.Main(String[] args) in c:\Users\s.ganji\Desktop\signalR_test\Program.cs:line 20
dependencies section of project.json :
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.1.0",
"Microsoft.Extensions.Logging": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0" ,
"Microsoft.Extensions.Options": "1.1.0" ,
"Microsoft.AspNetCore.SignalR": "1.0.0-*"
}
SignalR hasn't shipped and depends on newer things. You can't use it with 1.1.* or 1.0.0*.
By changing "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0"
to "Microsoft.Extensions.Options.ConfigurationExtensions": "1.2.0-*"
the problem solved, ithink I need to change all related dependencies of SignalRCore to version 1.2.0-*
@shahabganji , this helped. Problem was specifically with version of "Microsoft.AspNetCore.Routing" but good to update all.
Yes. deleting the bin folder worked fine for as well.
In my case deleting bin didn't work. One of the projects imported as dep used MVC.Core
1.1.1 while the rest used MVC
1.1.2, had to upgrade it!
+ <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.1" />
Most helpful comment
Hi svick
I deleted folder bin, obj and restart my computer, it's working ok now, I don't know why occur problem
Thank you for your help