Uh oh!
There was an error while loading. Please reload this page.
Add DuckDB tests - #1970
Conversation
mgravell
left a comment
There was a problem hiding this comment.
This is probably fine - I will need to try it locally - will try to do tomorrow
mgravell
commented
Oct 11, 2023
I'm happy to merge as-is, but FYI: this doesn't actually work for netfx - I see that there's a <ProjectSdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReferenceInclude="DuckDB.NET.Data.Full"Version="0.9.0.3"/>
</ItemGroup>
</Project>with: usingDuckDB.NET.Data;usingvarconn=newDuckDBConnection("Data Source=:memory:");conn.Open();gives: Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'duckdb': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at DuckDB.NET.NativeMethods.Startup.DuckDBOpen(String path, DuckDBDatabase& database, DuckDBConfig config, IntPtr& error)
at DuckDB.NET.Data.Internal.ConnectionManager.GetConnectionReference(DuckDBConnectionString connectionString)
at DuckDB.NET.Data.DuckDBConnection.Open()
at Program.<Main>$(String[] args) in C:\Code\ConsoleApp7\ConsoleApp7\Program.cs:line 4The packaging might not be right. I haven't looked to see what you're packaging and how - it doesn't look like there are native binaries in the nupkg itself, so I'm guessing that they are embedded resources in the dll? More of a topic for DuckDB, but you might prefer to embed them in the nupkg rather than the dll; I also haven't checked to see how the unmanaged dll works re cross-platform (normally I'd expect to see a bunch of platform-specific native dlls in the nupkg, for this purpose) (let me know if you need any help with any of this) |
mgravell
commented
Oct 11, 2023
Giorgi
commented
Oct 11, 2023
It doesn't work for netfx but works for net core. The native libraries are under |
Giorgi
commented
Oct 11, 2023
The native libraries are in another package that the top level depends on DuckDB.NET.Bindings.Full |
mgravell
commented
Oct 11, 2023
logged here: Giorgi/DuckDB.NET#151 - I guess the key bit is "it didn't work" |
mgravell
commented
Oct 11, 2023
@Giorgi ah, it is 32-bit vs 64-bit; see 151 |
mgravell
commented
Oct 11, 2023
(I still can't get the tests to run in netfx, but my standalone console works 🤷) |
mgravell
commented
Oct 11, 2023
I'm using SDK-style project, so this should work; it now works for the standalone console, if I explicitly use x64 rather than the implicit anycpu which is picking up x86 |


Test for #1952
The NuGet package includes native libraries too.