-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Data.SqlClientblockingMarks issues that we want to fast track in order to unblock other important workMarks issues that we want to fast track in order to unblock other important workbug
Milestone
Description
Repro Steps
- Install SDK 2.0.0-preview1-005899
- Create app using files below
dotnet restoredotnet publish -f netcoreapp2.0 -r win-x64bin\Debug\netcoreapp2.0\win-x64\Repro.exe
Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.TdsParser' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SNILoadHandle' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'sni.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Data.SqlClient.SNINativeMethodWrapper.SNIInitialize(IntPtr pmo)
dotnet publish -f netcoreapp2.0 -r win7-x64bin\Debug\netcoreapp2.0\win7-x64\Repro.exe(works as expected)- I assume
win-x86has the same issue, though I haven't tested.
Program.cs
using System;
using System.Data.SqlClient;
namespace Repro
{
class Program
{
static void Main(string[] args)
{
using (var connection = new SqlConnection(@"Data Source=(localdb)\MSSQLLocalDB;Database=master;Connect Timeout=30"))
{
connection.Open();
Console.WriteLine("ServerVersion: {0}", connection.ServerVersion);
}
}
}
}Repro.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win-x64;win7-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.4.0-preview1-25228-03" />
</ItemGroup>
</Project>NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>Metadata
Metadata
Assignees
Labels
area-System.Data.SqlClientblockingMarks issues that we want to fast track in order to unblock other important workMarks issues that we want to fast track in order to unblock other important workbug