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

Can't build using dotnet CLI #349

Closed
isaacabraham opened this issue Sep 3, 2019 · 7 comments
Closed

Can't build using dotnet CLI #349

isaacabraham opened this issue Sep 3, 2019 · 7 comments

Comments

@isaacabraham
Copy link

Description

We have a NET Core App 2.2 console application. MSBuild can build completely without issues. However, using dotnet build fails with the error:

rror 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)

We have FSharp.Data.SqlClient (2.0.5) referenced which has a dependency on SqlClient that gets resolved to System.Data.SqlClient (4.6.1). It's like that version is somehow getting ignored - not sure how or why?

@isaacabraham
Copy link
Author

Have also tried with a "clean" app today with .NET Core 2.0 - same issue.

@isaacabraham isaacabraham changed the title Can't build on .NET Core 2.2 Can't build using dotnet CLI Sep 4, 2019
@cmeeren
Copy link
Contributor

cmeeren commented Sep 30, 2019

I also get a similar error:

The type provider 'FSharp.Data.SqlFileProvider' reported an error: Could not load file or assembly 'System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Might it be the same issue as dotnet/Kerberos.NET#5? Quoting the final comments:

Last I looked, it's a build packaging issue. It's placing the net46 DLL into the Core folder, so it's screwing with references.

The build output path was causing the same DLL to be used in both locations.

If so, I guess the fix is simple.

@Swoorup
Copy link

Swoorup commented Oct 1, 2019

Same issue here.

@ghost
Copy link

ghost commented Nov 27, 2019

If I try to install the missing package manually, i get warnings about downgrades. Is FSharp.Data.SqlClient trying to load a different version of the library than the one it lists as a NuGet dependency?

/workspaces/*/*/*.fsproj : warning NU1605: Detected package downgrade: System.Data.SqlClient from 4.5.1 to 4.4.0. Reference the package directly from the project to select a different version.  [/workspaces/*/*.sln]
/workspaces/*/*/*.fsproj : warning NU1605:  * -> FSharp.Data.SqlClient 2.0.6 -> System.Data.SqlClient (>= 4.5.1)  [/workspaces/*/*.sln]
/workspaces/*/*/*.fsproj : warning NU1605:  * -> System.Data.SqlClient (>= 4.4.0) [/workspaces/*/*.sln]
/workspaces/*/*/*.fsproj : warning NU1605: Detected package downgrade: System.Data.SqlClient from 4.5.1 to 4.4.0. Reference the package directly from the project to select a different version. 
/workspaces/*/*/*.fsproj : warning NU1605:  * -> FSharp.Data.SqlClient 2.0.6 -> System.Data.SqlClient (>= 4.5.1) 
/workspaces/*/*/*.fsproj : warning NU1605:  * -> System.Data.SqlClient (>= 4.4.0)

@cmeeren
Copy link
Contributor

cmeeren commented Feb 29, 2020

This issue is preventing me from using VSCode/Ionide, since it seems to use the .NET Core SDK for Intellisense. It builds fine using MSbuild (manually), but intellisense in the DB file and everything depending on it is a red mess.

Any chance to have a look at it? As I said above, the fix might be very simple.

@101v
Copy link

101v commented Jun 12, 2020

Same issue: When I build using dotnet cli

error FS3033: The type provider 'FSharp.Data.SqlFileProvider' reported an error: Could not load file or assembly 'System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

@smoothdeveloper
Copy link
Collaborator

Closing in favor of #373 and #380.

related: dotnet/fsharp#10323

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