Using version of FSharp.Compiler.Service higher than 9.0.1 causes exception
See original GitHub issueUsing 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
- Create an F# Azure Function with manual trigger (or any other).
- Add a dependency to FSharp.Compiler.Service via project.json, latest version.
{
"frameworks": {
"net46":{
"dependencies": {
"FSharp.Compiler.Service": "11.0.6"
}
}
}
}
- 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)
- Save: compilation succeeds
- 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
- Programming language used: F#
- Links to source: https://github.com/mathias-brandewinder/fsibot-serverless/tree/98d5dc40226358c6e44b73a796197c01eb7658d1/process-mention
I can provide a smaller repro, if needed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should improve the error handling on this.
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?