Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly System.Runtime, Version=4.2.0.0 running Core 2.0 App on Azure

I developed a simple F# Suave application hosted in a console, using VS Code.

Target framework is core 2.0 and runs fine locally. The code is built and packaged (with references to System.Runtime 4.3.0) by VSTS and then deployed to an Azure App Service.

When I call the website it will eventually time out with HTTP 500, meanwhile suave*.log are written with the exception:

Unhandled Exception: System.IO.FileNotFoundException: Could not 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 file specified.

  • I did not change framework from 1.1 or 2.0, cleaned wwwroot anyhow
  • Tried assembly redirects in web.config and app.config

Does this mean some package still references 4.2.0.0? Is Azure in the wrong?

like image 918
Mulder Avatar asked Nov 08 '22 15:11

Mulder


1 Answers

I solved the error by creating and Self-contained deployment (https://learn.microsoft.com/en-us/dotnet/core/deploying/) although I'm not convinced this the preferable solution.

like image 182
Mulder Avatar answered Nov 14 '22 22:11

Mulder