Could not load file or assembly 'System.Runtime' or one of its dependencies after changing all project version from .net solution from 4.6.2 to 4.8

Viewed 21

I have .net solution with multiple projects now i have updated all projects from 4.6.2 to 4.8 and application giving error

Could not load file or assembly 'System.Runtime' or one of its dependencies.

Apart from changing project versions, anything else expected here?

in web.config file below are the declaration related to System.runtime

<dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
      </dependentAssembly>

also updated all packages using package manager

PM> Update-Package -Reinstall
1 Answers

Trust me, I am not joking. Remove all the System.Runtime dependencies from your config files and it will start working.

Related