5
votes

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?

1
Do you have Visual Studio? What's the result if you deploy the project to Azure through Visual Studio directly? Can you reproduce this issue with a new project? What are tasks of VSTS build and release definitions? Can you share the detail VSTS build and release log on the OneDrive?starian chen-MSFT
I have VS but can’t publish the project because it is an consoleapp; everything is done by VSTS. I have not yet tried reproducing this with a new project, that’ll need some time to setup. In the meantime I do have to buildsteps and logs on a onedrive: linkMulder
Could you run that application through dotnet command (dotnet xxx.dll)? If so, you can download the artifact from build, then run it and check the result. On the other hand, to do test with a new project can narrow down the issue.starian chen-MSFT
This hasn’t been resolved yet, although I found out some more; on the outside it looks like System.Runtime 4.3.0.0 is referenced (In the packages directory, in the IDE) but when inspecting de compiled dll, the reference is 4.2.0.0. I found a link (github.com/dotnet/core/issues/730) describing similar problems but solutions used there haven’t solved my problem yet. The next thing I wanna try is deploying an F# AspNetCore app using Suave, but the Suave.AspNetCore packages doesn’t support .Net Core 2.0 yet I think. I’m reconsidering my whole stack here…Mulder
Can you run the app through dotnet command?starian chen-MSFT

1 Answers

1
votes

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