Speckle.Core.Transports.TransportException: Failed to initialize DB connection

Hello community,

I have started to do a test of sending data to Spekcle but an exception is thrown every time I try to create a ServerTransport instance.

I followed the instructions described in this link and I always get the same exception.

Speckle.Core.Transports.TransportException: Failed to initialize DB connection ---> System.Exception: You need to call SQLitePCL.raw.SetProvider()

Does anyone have any idea how to solve this bug.

Thanks in advance

Welcome to Speckle @jsantana. I’m sorry your question was missed.

We haven’t seen this error before. Would you mind sharing your .csproj details with us?
What dotnet flavour/version are you targeting?
What other dependencies are you referencing?

Hi @jonathon,

In attachment the csproj file.
Treegram.Bridge.Speckle.csproj (22.3 KB)

I use .NET Framework 4.8

Thanks in advance

Hi @jsantana,
We’ve seen similar issues with this in the past when using the older .NET style projects.

Our general advice is to upgrade to using the newer SDK style projects for your csproj if you can.


My advice would be to create a new project using a newer .NET 6 template (since the NET4.X templates often still use the older style). Then replace the contents with this below. And copy your code files over to the new project.

You may need to re-import any other Nuget/package references manually.

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net48</TargetFramework>
        <PlatformTarget>AnyCPU</PlatformTarget>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Speckle.Objects" Version="2.16.0" />
    </ItemGroup>

</Project>

Any questions, don’t hesitate to ask

1 Like

There’s also a chance that simply calling SQLitePCL.Batteries.Init() before using any Speckle function will solve this issue for you if you didn’t want to upgrade your projects to use the new csproj format.

@jsantana did @Jedd 's suggestions help with your Transports problem?

1 Like

Sorry to add here, I have encountered this on a dotnet 8 app which has been published to a single file exe. I tried adding the SQLitePCL.Batteries.Init() but I got an Dll not found exception

It looks as though the fix of copying the e_sqlite3.dll file as well as the exe from this post was the answer: