Git Product home page Git Product logo

Comments (1)

oyundev avatar oyundev commented on September 3, 2024 1

To compile this example code:

using System;
using System.Data.SqlClient;
var connectionString = @"Data Source=.\SQLEXPRESS;Integrated Security=SSPI;";
using var sqlcon = new SqlConnection(connectionString);
sqlcon.Open();
Console.WriteLine($"Version: {sqlcon.ServerVersion} State: {sqlcon.State}");
sqlcon.Close();

Under Windows x64, download nuget package: system.data.sqlclient.4.8.2.nupkg
from https://www.nuget.org/api/v2/package/System.Data.SqlClient/4.8.2

Using 7zip, extract System.Data.SqlClient.dll (1.023.352 bytes) inside of nuget file:
system.data.sqlclient.4.8.2.nupkg->runtimes->win->lib->netcoreapp2.1->System.Data.SqlClient.dll

Now you can successfully (with some warnings) compile...

C:\Temp\sql>bflat.exe build sqlapp.cs -r .\System.Data.SqlClient.dll
ILC: Trim analysis warning IL2026: ..........

If you now try to run the executable it might fail because of a native dependency of System.Data.SqlClient.

C:\Temp>sqlapp.exe
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'sni.dll': The specified module could not be found.

Download nuget package: runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg
from https://www.nuget.org/api/v2/package/runtime.win-x64.runtime.native.System.Data.SqlClient.sni/4.4.0

Using 7zip, extract sni.dll (160.040 bytes) and then place it the same folder with your executable.

C:\Temp\sql>sqlapp.exe
Version: 15.00.2000 State: Open

from bflat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.