1

I have a Asp.netCore app.

I set its output to an exe.

I then compile it like so:

dotnet publish -r win-arm

I then open the network share on my Raspberry Pi running Windows 10 IoT.

I copy all the contents inside my published folder on desktop to a folder on my raspberry pi.

I then use powershell to start this exe off.

I then browse to the Raspberry Pis Ip address from my desktop.

my pages load fine.

If I now navigate to a page that I know will get records from my sqlite db I get this error:

enter image description here

Reading the error tells me (i think) I am using the wrong dll.

At present I am using the Dlls for Sqlite that I used on a previous uwp app that I also deployed to the raspberry pi box (and that worked).

I have Googled and it told me to use the uwp dlls. All I can think of it is because I compiled it using the arm switch I need to use a sqlite dll when using this on the Pi box.

Am I right and if so where can I get a arm sqlite dll?

if I am wrong what should I do?

Also I am using .netcore 2.1

These are the libaries I am using:

enter image description here

thanks

UPDATE.

Following Rita's answer I got a different error which is this:

enter image description here

14
  • Try using the SQLitePCLRaw.bundle_green NuGet package instead of SQLite libs / VS extensions if your min version at least equal to 16299. This will attempt to load the version of SQLite that is shipped with Windows itself (and hence should work on ARM IoT... if it's actually included in the IoT versions D;) rather than a version you ship with your app. Commented Oct 2, 2018 at 12:28
  • @JohnnyWestlake Thanks for your reply. I do have that already. As you can see in my updated question I have included lots of sqlite libraries in desperation. I had not originally included all of these though, So, now I am wondering should I remove some of them to properly test your suggestion? thanks Commented Oct 2, 2018 at 12:44
  • what's working for me is only these two packages: SQLitePCLRaw.Core and SQLitePCLRaw.provider.winsqlite3.uwp10, and then calling SQLitePCL.raw.SetProvider(new SQLite3Provider_winsqlite3()); before doing anything with SQLite. However that might not work because you're not in UWP. There's also a .NET 4.5 version of it, but no .NET Core package =[ Commented Oct 2, 2018 at 13:09
  • But worth trying the UWP package - I can't find the source for it but it may be .Net Core friendly. Commented Oct 2, 2018 at 13:16
  • @JohnnyWestlake I did try the uwp with core but it did not work. I have removed all the sqlite libs and only installed raw and raw_green. But my tags like: [PrimaryKey] etc are not recognosed so cannot build and test Commented Oct 2, 2018 at 13:22

1 Answer 1

1

This issue due to e_sqlite3.dll missed in asp.net core app publish folder. You can find similar issues on Github like this.

There is a workaround I test on Raspberry Pi with Windows IoT Core and it works for me.

Find the winsqlite3.dll in \Windows\system32 on Raspberry Pi and copy this file to your app publish folder and rename this file to e_sqlite3.dll. Then it will work.

Only Microsoft.Data.Sqlite nuget package needs to install.

The .csproj file content:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.Data.Sqlite" Version="2.1.0" />
  </ItemGroup>

</Project>
Sign up to request clarification or add additional context in comments.

3 Comments

looks promising! I shall be testing soon. Will get back to you.Many Thanks! :)
Did not work ;( I am gutted. But I got a different error this time which I will update my question with
I just read your answer properly. I had originally copied that dll from my desktop windows\system folder and not from the pi hard drive. So did as you instructed and it all works!! I I could give you double the points I would. I was resigned to creating a background worker and use that to talk to the db and pass stuff back and forth. Glad I do not have to now :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.