Skip to content

Error loading System.Data.SqlClient when using .net core runner #3097

Answered by augustoproiete
achikhv asked this question in Q&A
Discussion options

You must be logged in to vote

@achikhv The issue is that System.Data.SqlClient for .NET Core depends on other NuGet packages that need to be downloaded as well by Cake. If you expand the "Dependencies" accordion on nuget.org you see something like this:

In the .NET Framework world these dependencies already exist on your Global Assembly Cache (GAC), which is why it works today.

Cake currently does not download dependencies by default, so you have to be explicit about it by adding a &loaddependencies=true to the addin preprocessor directive:

#addin System.Data.SqlClient&version=4.5.0&loaddependencies=true

// ...

The above should resolve the error you're seeing.


ps:

  • System.Data.SqlClient has been superseded by Micr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@achikhv
Comment options

Answer selected by achikhv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3096 on February 08, 2021 05:37.