-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Labels
Description
Hi,
I'm facing an issue while trying to execute the following script which loads the System.Data.SqlClient nuget package:
#! "netcoreapp2.0"
#r "nuget:NetStandard.Library,2.0.0"
#r "nuget:System.Data.SqlClient, 4.4.0"
using System.Data.SqlClient;
using (var connection = new SqlConnection(""))
{
connection.Open();
Console.WriteLine("Hello world!");
}
This seems to be loading the default implementation of System.Data.SqlClient instead of the one specific to the platform.
The error message is:
PS C:\Temp\tdstest> dotnet script .\helloworld.csx
Script execution resulted in an exception.
System.Data.SqlClient is not supported on this platform.
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Submission#0.<<Initialize>>d__0.MoveNext() in C:\Temp\tdstest\helloworld.csx:line 7
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
System.Data.SqlClient is not supported on this platform.
Any idea if and how I could workaround this?
Thanks in advance