הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Wednesday, October 24, 2018 11:18 AM
Hi
I have written a small app using SQLite as an embedded database. I have the need to use views, so using this instead of SQL Compact
All works fine, as in I can run the app from VS, present the screen and grab all the data needed from the file in the application directory.
However, on publish I get the following exceptions. On installing via NuGet, everything seemed fine. Is there anything esle needed. I did try to add SQLite.Interop.dll' to the project but and used 'content' copy always. However, this did not work either.
Regards
Steve
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'App1.bas_functions' threw an exception. > System.DllNotFoundException: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEnum op)
at System.Data.SQLite.SQLite3.StaticIsInitialized()
at System.Data.SQLite.SQLiteLog.Initialize(String className)
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at App1.bas_functions..cctor()
End of inner exception stack trace
at App1.bas_functions.GetDataset1(String select_statement)
at App1.Main_Form.LoadCountermeasures()
at App1.Main_Form.Main_Form_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at Syncfusion.Windows.Forms.MetroForm.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Syncfusion.Windows.Forms.MetroForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
All replies (3)
Wednesday, October 24, 2018 11:25 AM
Your Application is expecting SQLite.Interop.dll in bin\debug folder just copy that to bin\debug
or
Add SQLite.Interop.dll to your project , Right click on project -> Add existing Item -> Browse to SQLite.Interop.dll
then After adding to solution explorer of your project Select .dll and go to properties -> select 'copy always' In Copy To output directory property
Wednesday, October 24, 2018 11:27 AM | 1 vote
If not using the following installer for VS2017 (there is a link on the page for a VS2015 edition too) please consider trying it.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator
Thursday, October 25, 2018 8:32 AM | 1 vote
Hi,
try to install the C++ runtime:
Microsoft Visual C++ 2008 SP1 Redistributable (X86, X64)
Microsoft Visual C++ 2010 SP1 Redistributable (X86, X64)
Microsoft Visual C++ 2012 SP1 Redistributable (X86, X64)
...
Best Regards,
Alex
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.