Error loading System.Data.SqlClient when using .net core runner #3097
-
What You Are Seeing?I am using cake runner for .net framework and considering migrating to .net core runner. My build scripts uses SqlConnection from System.Data.SqlClient to execute some SQL.
What is Expected?SqlClient and all of its dependencies are loaded without errors. What version of Cake are you using?0.38.5 Are you running on a 32 or 64 bit system?64-bit What environment are you running on? Windows? Linux? Mac?Windows Are you running on a CI Server? If so, which one?No How Did You Get This To Happen? (Steps to Reproduce)
Output Loghttps://gist.github.com/achikhv/95539747148cd3e6e35b7a4e8a6da4de |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@achikhv The issue is that 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 #addin System.Data.SqlClient&version=4.5.0&loaddependencies=true
// ... The above should resolve the error you're seeing. ps:
|
Beta Was this translation helpful? Give feedback.
@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:The above should resolve the error you're seeing.
ps:
System.Data.SqlClient
has been superseded byMicr…