System.Runtime, Version=4.2.1.0, PublicKeyToken=b03f5f7f11d50a3a has a higher version than referenced assembly
15:54 20 Nov 2018

I upgraded my ASP.NET Core application from .NET Core 2.0 to .NET Core 2.1. I can run the solution in my localhost but when I deploy it to another server there is an exception (shown below).

The steps I have done to solve the issue so far are below and it throws the same error.

Does anybody have any suggestion how to solve this issue?

Steps I've done:

  1. Modify the setting for the project

      
         netcoreapp2.1
         AnyCPU;x64
         2.1.0
         true
         true
       
    
  2. I also added binding redirect in the web.config

     
       
         
         
       
     
    
  3. Install .NET Core 2.1 on the server

  4. I also deleted my .vs folder and restarted Visual Studio.

Exception:

Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: One or more compilation failures occurred:error CS1705: Assembly Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

asp.net-core .net-core runtime .net-core-2.1