question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using version of FSharp.Compiler.Service higher than 9.0.1 causes exception

See original GitHub issue

Using a version of FSharp.Compiler.Service (FCS) higher than 9.0.1 in an Azure Function potentially causes runtime exceptions, because the Azure WebJobs SDK relies on FCS 9.0.1. Compilation succeeds, but version 9.0.1 is loaded at runtime instead of 11.0.6, which causes crashes when using functionality available in 11.0.6 but not in 9.0.1.

Repro steps

  1. Create an F# Azure Function with manual trigger (or any other).
  2. Add a dependency to FSharp.Compiler.Service via project.json, latest version.
{
  "frameworks": {
    "net46":{
      "dependencies": {
        "FSharp.Compiler.Service": "11.0.6"
      }
    }
  }
}
  1. In the code, use any feature present in FSC 11.0.6 but not in FSC 9.0.1 (see http://stackoverflow.com/q/42755884/114519 for an example)
  2. Save: compilation succeeds
  3. Run: exception is triggered, such as:
Exception while executing function: Functions.fsc-1. mscorlib: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Expected behavior

Compilation error.

Actual behavior

Successful compilation but runtime exception.

Known workarounds

Reverting to FSC 9.0.1

Related information

The following answer on StackOverflow describes the issue in more detail, with related information: http://stackoverflow.com/a/42894076/114519

I can provide a smaller repro, if needed.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
christopherandersoncommented, Mar 27, 2017

Should improve the error handling on this.

1reaction
mathias-brandewindercommented, Mar 21, 2017

I think warnings would be a great start, this caused quite a bit of head-scratching on my end 😃 More broadly, do you have any advice or plans to support a scenario like this one, where I’d want to use a version of a package that is not the same as the one that ships by default?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving FSharp.Compiler.Service clashes · Issue #1096
This means that if a build script references its own (different) version of F.C.S. that is not compatible with the one bundled with...
Read more >
f# - Azure Function: "Unable to load one or more of the ...
I believe the reason for this is that Azure Functions SDK depend on FSharp.Compiler.Service (FCS) version 9.0.1.
Read more >
Compiler Options - F# | Microsoft Learn
Use F# compiler command-line options to control the compilation of your F# apps and libraries.
Read more >
Using Newtonsoft.Json in a Visual Studio extension
When referencing a lower version of Newtonsoft.Json than ships in Visual Studio, a binding redirect is in place to automatically change the ...
Read more >
Migrating Complex NuGet solutions to Paket
In the previous post of this series, we looked at migrating a simple, single-project solution over to Paket. In this post, we'll look...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found