-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error with .NET 6, SqlProgrammabilityProvider and WebSharper #1264
Comments
As a first check, I tried disabling the Booster by adding |
I'm looking at this, this must be something in fsc.exe vs Compile API in FSharp.Compiler.Services. Error happens during F# compilation via FCS, not in any WebSharper logic, so that at least narrows it down. |
Following the trail of compilation issues with FSharp.Data.SqlClient, leads to recent activity by its developers to find a solution dotnet/fsharp#10323 (comment). |
@cadull @granicz Sorry for the late answer but there is no easy solution, except maybe going back to using WebSharper 4.x which has net4x compilation support. WebSharper 5/6 runs the compiler on .NET 5/6, which includes doing the F# compilation too and there is no net4x fallback. So you won't gain anything by trying to force the F# compilation task to the net4x compiler, as WebSharper is skipping that anyways to do F#+JS compilations in single execution. An fsc.props trick could work to get a project using SQLProvider build via Underlying cause is that SQLProvider TP is non-compliant on .NET Core-based compiler execution, they have multiple tickets around this... https://github.com/fsprojects/SQLProvider/issues?q=is%3Aissue+is%3Aopen+label%3A%22.NET+Core+reference+assembly+loading%22 So current workarounds are:
Re-adding net4x compilation path to WebSharper 6+ is not in the plans. |
(Reported by Clinton Düll - see original forum ticket at https://forums.websharper.com/topic/92665)
An F# .Net 6 library using SqlProgrammabilityProvider will fail to compile if the WebSharper.FSharp package is referenced. The following error arises:
error FS3033: The type provider 'FSharp.Data.SqlProgrammabilityProvider' reported an error: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
.Steps to reproduce:
type S = SqlProgrammabilityProvider<"">
(ignore the empty string compilation error, or add a valid connection string).I'm reorganising a project and may not need this combination, but spent some time narrowing down the issue. The dependency of SqlProgrammabilityProvider on the .Net Framework at compile time may be of interest (https://fsprojects.github.io/FSharp.Data.SqlClient/netcore.html).
The text was updated successfully, but these errors were encountered: