Note that there are some explanatory texts on larger screens.

plurals
  1. POExceptions in F# when running on Azure
    primarykey
    data
    text
    <p>We have a C# web role running in Azure, and the C# project invokes code in an F# dll that we deploy with our app. </p> <p>When we’re running locally using the local Azure emulator, our F# code is invoked and runs fine. When it’s running in Azure in the cloud, our F# code fails at a certain point with this exception:</p> <blockquote> <p>Failed to parse x's function: var(2).Exception: System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'FSharp.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'<br> at Microsoft.FSharp.Text.Lexing.LexBuffer<code>1.FromArray(char[] s) at Microsoft.FSharp.Text.Lexing.LexBuffer</code>1.FromString(String s) at Marshal.vars@27.GenerateNext(IEnumerable`1&amp; next)<br> WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. .Will use default function.</p> </blockquote> <p>We have found some posts that suggest it’s because :</p> <blockquote> <p>Windows Azure runs applications in partial trust, as part of sandboxing their execution. However, the F# core libraries are currently installed into the GAC, but do not have the AllowPartialTrustedCallers attribute. So when building F# applications to be run in Azure, the F# libraries must be statically linked using --standalone. The provided templates take care of this, but you'll notice the following side-affects: • Longer than usual compile times • Large set of references • A dummy reference to "RDManaged.dll"</p> <p><a href="http://archive.msdn.microsoft.com/fsharpazure" rel="nofollow">http://archive.msdn.microsoft.com/fsharpazure</a></p> </blockquote> <p>To try to get round this, we follow the advice below and put the <code>–standalone</code> flag in the Build config of our F# library.</p> <p><a href="http://www.42spikes.com/post/F-and-Azure.aspx" rel="nofollow">http://www.42spikes.com/post/F-and-Azure.aspx</a></p> <p>However, the F# library doesn’t compile with this flag. We get this build error:</p> <blockquote> <p>Error 3 A problem occurred writing the binary 'obj\Debug\Analyzer.dll': Error in pass2 for type Microsoft.FSharp.Text.StructuredFormat.Joint, error: One of your modules expects the type 'System.Collections.IStructuralEquatable' to be defined within the module being emitted. You may be missing an input file FSC 1 1<br> Analyzer</p> </blockquote> <p>Could this build error be because of the dependencies our F# project has? It references FSharp.PowerPack.dll and Microsoft.Z3.dll, as well as another C# library in our solution, AnalyzerCommon.dll (which just contains a common interface that both our F# and C# code implement).</p> <p>It's interesting that the F# code is called and runs fine, it's only until it hits a certain part of the code - a formula parser that uses FSharp.PowerPack.dll.</p> <p>Any tips would be greatly appreciated.</p> <p>Thanks, Sam</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload