Monogame And SQLite.net ClickOnce publish Issues.

I just graduated from school with a BS in CS and I want to use one of my projects I made in class for portfolio. It is a trivia maze where I recreated Link from the NES Legend of Zelda and made my own dungeon using inspiration from the first dungeon in the game. I have Link able to move about freely and I resolve collisions so Link cannot pass through walls or objects. The other requirement is that we had to use SQL to store the questions and answers. I initially used System.Data.Sqlite from nuget and then I used SQLite-net 1.08…

I want to be able to publish this to my website so a future employer can download it and run the game without having to have Visual Studio or all the source code. The source will be provided as well, but I want all future employers to have access to it.

When I go to publish the game, it creates everything fine. When I try to install the game, it crashes. The Just In Time debug states there is “an unhandled Microsoft .NET Framework exception in my.exe[xxxx]”

Things I have tried:

1.) I tried changing the sql that I am using from two different packages. Both fail. However, the Sqlite-net worked in another project that doesn’t use Monogame and it publishes and installs just fine.

2.) I recreated the project from scratch thinking that maybe something has been added by me by mistake causing the issue. This changed nothing.

3.) I have an old buggy build of the trivia game before I implemented the sql side of things and it publishes and installs just fine.

I have spent several days researching this and I cannot find much about this. Most I have read is that sometimes the Content folder is not generated. My Content folder is generated.

After all the experimentation, I have come to the conclusion it is an issue between Monogame.Framework, and whatever Framework SQLite uses. I can publish a monogame without SQLite and install it just fine. I can publish a Window Forms without monogame with SQLite and install it just fine. I CANNOT publish a monogame project that uses SQLite.

Does anybody have experience using SQLite with monogame and have successfully deployed it? I would like to keep the SQLite portion of the project but I may just hardcode the trivia questions in an array and access it that way.

Any help would be great. Thank you for your time.

I am also using SQLite, though I have simply added the 8-10 dlls to my game. It may not be allowed due to Microsoft’s rules, but I wanted to free the users to install the redist version of SQLite just to be able to play the game. When I finish my game, I will come back to this “how to properly reference SQLite dlls” question. :smiley:

So, for the time being you can add the necessary SQLite dlls to your game and directly reference them in the code.