I have a problem when I'm deploying my application to server.
I'm getting an error:
> HTTP Error 502.5 - Process Failure
In log file I can see:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationProvider.Load(IDictionary envVariables) at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Microsoft.AspNetCore.Hosting.WebHostBuilder..ctor() at Travelingowe.Program.Main(String[] args) in E:\Projects\Travelingowe\Program.cs:line 20
Here's my project.json
{"userSecretsId": "aspnet-travelingowe-c23d27a4-eb88-4b18-9b77-2a93f3b15119","dependencies": {"Hangfire.AspNetCore": "1.6.8","HangFire.SqlServer": "1.6.8","MailKit": "1.10.2","Microsoft.AspNetCore.Diagnostics": "1.1.0","Microsoft.AspNetCore.Mvc": "1.1.1","Microsoft.AspNetCore.Razor.Tools": {"version": "1.1.0-preview4-final","type": "build" },"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0","Microsoft.AspNetCore.Server.Kestrel": "1.1.0","Microsoft.AspNetCore.SpaServices": "1.1.0-*","Microsoft.AspNetCore.StaticFiles": "1.1.0","Microsoft.EntityFrameworkCore.Design": "1.1.0","Microsoft.EntityFrameworkCore.SqlServer": "1.1.0","Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final","Microsoft.Extensions.Configuration.Binder": "1.1.0","Microsoft.Extensions.Configuration.CommandLine": "1.1.0","Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0","Microsoft.Extensions.Configuration.Json": "1.1.0","Microsoft.Extensions.Configuration.UserSecrets": "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","Serilog": "2.4.0","Serilog.Extensions.Logging": "1.4.0-dev-10138","Serilog.Extensions.Logging.File": "1.0.1-dev-00008","System.IO.FileSystem": "4.3.0","System.IO.FileSystem.Watcher": "4.3.0","System.Xml.XDocument": "4.3.0" },"tools": {"Microsoft.AspNetCore.Razor.Tools": "1.1.0-preview4-final","Microsoft.DotNet.Watcher.Tools": "1.1.0-preview4-final","Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview4-final","Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final","Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final" },"frameworks": {"netcoreapp1.1": {"dependencies": {"Microsoft.NETCore.App": {"type": "platform","version": "1.1.0" } },"imports": "dnxcore50" } },"buildOptions": {"emitEntryPoint": true,"preserveCompilationContext": true,"compile": {"exclude": [ "node_modules" ] } },"runtimeOptions": {"configProperties": {"System.GC.Server": true } },"publishOptions": {"include": ["appsettings.json","ClientApp/dist","Views","web.config","wwwroot" ],"exclude": ["wwwroot/dist/*.map" ] },"scripts": {"prepublish": ["npm install","node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod","node node_modules/webpack/bin/webpack.js --env.prod" ],"postpublish": ["dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] },"tooling": {"defaultNamespace": "Travelingowe" } }
Here's my web.config
<?xml version="1.0" encoding="utf-8"?><configuration><!-- Configure your application settings in appsettings.json. Learn more at https://go.microsoft.com/fwlink/?LinkId=786380 --><system.webServer><handlers><add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/></handlers><aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\..\logs\stdout" forwardWindowsAuthToken="false"/></system.webServer></configuration>
Locally eveything works fine.
Do you have any idea how to fix it ?