Click here to Skip to main content
14,669,324 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am developing a Windows Forms application in C #, in Visual Studio 2019 Community.

I am using the SQL Server CE database, it is working properly in my application, however when I install my application on another computer, the application generates the following error:
"System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe,"

What I have tried:

I'm using innosetpu to make the installer of my application, as little as I understand, I believe that I should take the dlls that I used from SQL Server CE together with the executable of my application, however every time I try to simply take it, the error I end up with delete the dll ...
Posted
Updated 19-Apr-20 9:30am
Comments
João Henrique Braga 19-Apr-20 11:59am
   
But how could I do this within my application? because I don't want to make the user have to install an assignment more ...
0x01AA 19-Apr-20 12:37pm
   
Read through this:
deployment - How to deploy SQL Server Compact Edition 4.0? - Stack Overflow[^]

You will find there which COM have to be registered during installation and also if you prefer the hard way how to use COM register free.

Rate this:
Please Sign up or sign in to vote.

Solution 1

SQL Server Compact Edition has been deprecated, no new versions or updates are planned, so it might be better to seek an alternative.
If your demands are simple you can try LiteDB[^] which does not need to be installed as it is just a dll that you can distribute with your application.

If you want to stick with SQL Server CE take a look at:
GitHub - domgho/InnoDependencyInstaller: Modular Inno Setup Dependency Installer[^]
It supports installing all kinds of prerequisites like .NET framework, SQL Server, C++ Redistributables etc.
   
v2
Comments
Maciej Los 19-Apr-20 12:33pm
   
5ed!
João Henrique Braga 19-Apr-20 12:53pm
   
But how can I distribute a dll with my application?
RickZeeland 19-Apr-20 12:57pm
   
just add it to your InnoSetup script, or copy the bin folder with all .exe and .dll files.
Maciej Los 19-Apr-20 13:14pm
   
I would like to give you another 5 for second part of your answer, but i can't :(
RickZeeland 19-Apr-20 13:20pm
   
Bummer :(
Rate this:
Please Sign up or sign in to vote.

Solution 2

Here's my Inno "Files" section from my last install of CE. (Windows 10 has SQLite "built in" and is my current preference)

; SQL CE
Source: "..\bin\Release\x86\*.dll"; DestDir: "{app}\x86"
Source: "..\bin\Release\x86\Microsoft.VC90.CRT\*.*"; DestDir: "{app}\x86\Microsoft.VC90.CRT"

Source: "..\bin\Release\amd64\*.dll"; DestDir: "{app}\amd64"
Source: "..\bin\Release\amd64\Microsoft.VC90.CRT\*.*"; DestDir: "{app}\amd64\Microsoft.VC90.CRT"
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100