Failed to load System.Runtime file or assembly, Version = 4.2.0.0 using Core 2.0 application on Azure

I developed a simple F # Suave application hosted on the console using VS Code.

The target structure is core 2.0 and works fine locally. The code is built and packaged (with links to System.Runtime 4.3.0) VSTS, and then deployed to Azure App Service.

When I call the website, it will eventually expire with HTTP 500, meanwhile it is suave*.logwritten with the exception:

Unhandled exception: System.IO.FileNotFoundException: Failed to load file or assembly "System.Runtime, Version = 4.2.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" or one of its dependencies. The system cannot find the specified file.

  • I did not change the framework from 1.1 or 2.0, cleared wwwroot anyway
  • Checked assembly redirection in web.config and app.config

Does this mean that some package is still referencing 4.2.0.0? Is Azure Wrong?

+4
source share
1 answer

I resolved the error by creating a self-contained deployment ( https://docs.microsoft.com/en-us/dotnet/core/deploying/ ), although I'm not sure if this is the preferred solution.

+1
source

Source: https://habr.com/ru/post/1687749/


All Articles