Skip to content
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

build problem with dotnet\sdk\3.0.100 #361

Closed
jackfoxy opened this issue Oct 17, 2019 · 5 comments
Closed

build problem with dotnet\sdk\3.0.100 #361

jackfoxy opened this issue Oct 17, 2019 · 5 comments

Comments

@jackfoxy
Copy link

Description

Does not build with dotnet\sdk\3.0.100 or higher.

set framework to netstandard2.1
error:

<somefile>.fs(12,24): error FS0039: The type 'SqlCommandProvider' is not defined [\MyProject.fsproj]

set framework to netstandard2.0
error:
(same error)

set framework to net472
error:

error FS3033: The type provider 'FSharp.Data.SqlCommandProvider' reported an error: Could not load type 'System.Data.SqlClient.SqlConnection' from assembly 'System.Data.SqlClient, Version=4.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. [\MyProject.fsproj]

In the case of net472 it should be finding System.Data.SqlClient, Version=4.7, which is available in packages\...lib\netstandard2.0 via paket.

Repro steps

  1. Use paket in usual manner for dependencies, either specifying framework or autodetect, does not matter.

  2. Use FAKE build:

let configuration = "Release"
let buildConfiguration = DotNet.Custom <| Environment.environVarOrDefault "configuration" configuration
projectsToBuild
        |> Array.iter (fun x -> 
            DotNet.build (fun p ->
                { p with
                    Configuration = buildConfiguration }) x
        )

Related information

This builds successfully in any of these 3 frameworks when built from Visual Studio, which uses a MSBuild.exe from

Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin

DotNet build uses MSBuild.dll from the

dotnet\sdk\3.0.100

folder.

@brettrowberry
Copy link

I was just struggling with this. Thanks for filing the issue!

@jackfoxy
Copy link
Author

@brettrowberry glad to hear confirmation. I struggled with getting it to the point where I could file an issue.

@MarneeDear
Copy link

I had the same problem today. It seems the workaround is to continue to use the fsc.props file. More details in #373 .

@melanore
Copy link

melanore commented Apr 3, 2020

https://github.com/demetrixbio/FSharp.Data.Npgsql is very similar to FSharp.Data.SqlClient. We recently migrated to netstandard2.0 without any net461 dependencies. It works smoothly on Windows/Unix using 3.1.201 SDK. If you are having issues, I would suggest to try new SDK.

@jackfoxy
Copy link
Author

I have moved on to 3.1.201 SDK, and since 3.1 has dotnet long term support and 3.0 does not, I recommend closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants