Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation

Confirming the comment made above by dwilliss also worked for me. The solution was to get rid of:

<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>

(In my case from the app.config, for a Windows Service.) My project has an indirect dependency to System.Runtime.InteropServices.RuntimeInformation only. It is a dependency of a NuGet package I imported.


Could you be missing the loaded assembly from your configuration file? Ensure you have something similar to the following within your web.config. NuGet would normally do this but maybe it hasn't and it doesn't know what to load in

<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>

If you have updated a project's .NET runtime version from a version before 4.7.1 to 4.7.1 or later then uninstall the Nuget package, delete / comment out the App.config part if it remains, and re-add the reference from the framework. It is in the framework from 4.7.1 onward, before that you had to add a Nuget package.

[edit]... as per Michael's comment above that I upvoted before living memory.