-
Notifications
You must be signed in to change notification settings - Fork 71
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
Any 2023 tricks for running on Windows? #427
Comments
@cr3wdayt5p thanks for the extensive and detailed bug report. I'll try to investigate it, you can also check if the issue is the same with the dotnet framework, if you have ability to target it. In the meantime, since you mention it works fine on Linux and macOs and fails on Windows, I'd suggest the issue be reported to the dotnet sdk itself, either it is an issue in the dotnet sdk, or in the System.Data.SqlClient package, which I think is also part of the SDK. I don't think there is anything platform specific in this repository that would cause the issue specifically. It could also be that the F# compiler on windows is doing something different in context of compile time loading of dependencies that the type provider brings in the compilation. |
I don't have the ability to target dotnet framework. But I did try both My guess is that But the first step to really investigate this issue would be to make the type provider output the full content of the exception thrown by |
@cr3wdayt5p thanks for additional details. You may bring your own feedback on those issues, or try to open specific one, asking about native dependency loading in context of type providers on dotnet/fsharp. Also, please consider if dotnet/fsharp#4956 and dotnet/fsharp#10323 have some relevancy, you could expand your perspective on the discussions there. I'm also facing issues related to this and other type providers in Rider since recent dotnet sdk (such as loading of System.Runtime.Caching, etc.), I think they all pertains to breaking changes in dotnet SDK. If there is a known way of fixing it in this particular type provider disregarding of the SDK, I'd be glad to make a new release with such fix. |
What are the tips, tricks, and hacks for making
FSharp.Data.SqlClient
run on Windows in 2023? In other words: What is smallest working example project for Windows?I have been happily using
FSharp.Data.SqlClient
in a project that I develop on macOS and deploy to Azure Functions (Linux). I have had no problems after finding the initial trick to loadSystem.Data.SqlClient
(#373 (comment)).But now I would like my colleagues with Windows machine to be able contribute to the project. But I don't know how to solve the build error:
The type initializer for 'System.Data.SqlClient.TdsParser' threw an exception.
Repro Steps
OS: Windows 10
.NET SDK: 7.0.202
Test.fs
Test.fsproj
Run:
dotnet build
Expected behavior
The build should succeed and work on Windows just like it does on macOS (with adjusted path to
System.Data.SqlClient.dll
).Actual behavior
Build error:
There are no further details about the exception thrown by
System.Data.SqlClient.TdsParser
(even usingdotnet build -v:d
). Does anyone know how to get more details? Or completely solve this issue?Related information
The trick to provide the
System.Data.SqlClient.dll
(#373 (comment)) works as excepted and solves this error:Test.fs(7,18): error FS3033: The type provider 'FSharp.Data. SqlCommandProvider' reported an error: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture =neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies cannot be loaded for execution. (0x80131058)
The connection string used for this experiment has been tested with a small project using
System.Data.SqlClient
directly, and it works as expected on the Windows machine.The text was updated successfully, but these errors were encountered: