Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy a web application using F# to Azure Web Site

When I deploy my web application to an Azure Web Site, I am getting the following error:

Could not load file or assembly 'FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I have encountered this in the past when deploying to an IIS server and fixed it by installing the F# redistributable http://www.microsoft.com/en-us/download/details.aspx?id=13450

Does anyone know what I can do to get this working on an Azure Web Site (not an Azure Web Role)?

Also, I do have Copy Local set to true for the FSharp.Core library from where it is being referenced.

like image 688
Scott Smith Avatar asked Oct 26 '12 23:10

Scott Smith


People also ask

How do I deploy a website using IIS?

In IIS, right-click the Default Web Site, choose Deploy > Configure Web Deploy Publishing. If you don't see the Deploy menu, see the preceding section to verify that Web Deploy is running. In the Configure Web Deploy Publishing dialog box, examine the settings. Click Setup.


1 Answers

Reposting from comment:

In my experience, in order to use an F# library from a C# project in Azure, it is necessary to reference FSharp.Core directly from the C# project in order for the proper assemblies to be uploaded. With C#-to-C# project references the 'Copy Local' property seems to propagate correctly, whereas with C#-to-F# references it does not.

I assume compiling with the --standalone flag probably works as well, but I haven't tried it personally.

like image 179
ildjarn Avatar answered Nov 15 '22 07:11

ildjarn