Deploying System.Data.SQLite again

Topics: Help
Jul 22, 2011 at 11:11 PM

Hi,

Im using VS2010, with target set to .NET v2  and Platform x86  (Im using some old DLL's and OCX's in this project so i can't upgrade to .NET 4)

Ive been using this control for almost 2 years now, but have just upgraded to the very latest version which 'auto detects' the required

SQLite.  The app run fine in the IDE but when i deploy, i see the SQLite.dll installed, but the app throughs an exception saying 

'could not load assembly System.Data.SQLite. v1.0.073.0

I looked at previous posts and also tried to create the 2 folders and put the x86 and x64 dlls in there, but still the error.

Ive migrated all my projects into VS2010 from VS2005 and this is the only thing stopping me rolling out the upgrades.

 

Thanks,

Paul.

Jul 23, 2011 at 11:29 AM

please share you test project, i'll check whats really wrong with it, ..you shouldn't see SQLite.dll installed, because it's deep somewhere in local app directory.. maybe you still added reference, remove it

Jul 23, 2011 at 2:13 PM

I've removed all references to SQLite , built and deployed, this time there is no SQLite.dll in the app's folder and yes, it has created a hidden folder v73_NET2_x86 with the DLL in it.

But still my app says can't load assembly . System.Data.SQLite

I have only added references to GMap.NET.Core   and GMap.NET.WindowsForms,  thats all.

 

My project is very large, maybe i have to cut it down and try and share, its also in 2 parts, a 'runtime' app that installs all my common dll's etc etc and then

a simple single .EXE app.

 

Thanks,

Jul 23, 2011 at 2:53 PM

did you tried debug build, what exception it prints?

Jul 23, 2011 at 3:21 PM

Yes, its a debug build.

the exception is the usual     :

 

Unhandled exception,

Could not load file or assembley   'System.Data.SQLite, Version=1.0.73.0 '

i see the DLL in the Local settings\application data\GMap.Net\DLLCache\v73_NET2_x86 folder

Jul 23, 2011 at 3:36 PM

i mean debug output log..

Jul 23, 2011 at 3:41 PM

The machine i am installing on dos'nt have VS2010 installed.   Where/How can i get the debug output log ?

Jul 23, 2011 at 3:47 PM

 

 

 

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.73.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)File name: 'System.Data.SQLite, Version=1.0.73.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' ---> System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.73.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)File name: 'System.Data.SQLite, Version=1.0.73.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' ---> System.Runtime.InteropServices.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)   at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)   at System.Reflection.Assembly.LoadFile(String path)   at GMap.NET.CacheProviders.SQLitePureImageCache.CurrentDomain_AssemblyResolve(Object sender, ResolveEventArgs args)   at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName)

   at GMap.NET.Singleton`1.get_Instance()   at GMap.NET.WindowsForms.GMapControl.set_CacheLocation(String value)   at ApplicationProject.Map..ctor()   at ApplicationProject.frmCoreAccounting_Accounts.InitializeComponent()   at ApplicationProject.frmCoreAccounting_Accounts..ctor()   at ApplicationProject.frmSalesLedger_Core_Customer..ctor()   at ApplicationProject.frmSalesLedger_Customer..ctor()   at ApplicationProject.Module_SalesLedger.RunProgram(String Key, String FullKey, Boolean& KeyFound)   at ApplicationProject.BSL.Module_RunProgram(String Program, String FullKey)   at ApplicationProject.App.fApplicationForm_RunProgram(String Program, String FullKey)   at ApplicationProject.frmCore_MainMenu.uebSubMenu_ItemClick(Object sender, ItemEventArgs e)   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar.OnItemClick(ItemEventArgs e)   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar.FireEvent(UltraExplorerBarEventIds id, EventArgs e)   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarItem.DoClick()   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar.Infragistics.Win.ISelectionManager.OnMouseUp(MouseMessageInfo& msginfo)   at Infragistics.Win.SelectionStrategySingle.OnMouseMessage(ISelectableItem item, MouseMessageInfo& msginfo)   at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e)   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)   at Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar.OnMouseUp(MouseEventArgs e)   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)   at System.Windows.Forms.Control.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)



************** Loaded Assemblies **************mscorlib    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------ApplicationProject    Assembly Version: 1.0.0.0    Win32 Version: 1.0.0.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/ApplicationProject.exe----------------------------------------System.Drawing    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------System    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------GMap.NET.Core    Assembly Version: 1.5.5.5    Win32 Version: 1.5.5.5    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/GMap.NET.Core.DLL----------------------------------------System.Windows.Forms    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------Microsoft.VisualBasic    Assembly Version: 8.0.0.0    Win32 Version: 8.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll----------------------------------------Infragistics.Win.UltraWinMaskedEdit.v3.2    Assembly Version: 3.2.20042.1111    Win32 Version: 3.2.20042.1111    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/Infragistics.Win.UltraWinMaskedEdit.v3.2.DLL----------------------------------------Infragistics.Win.v3.2    Assembly Version: 3.2.20042.1111    Win32 Version: 3.2.20042.1111    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/Infragistics.Win.v3.2.DLL----------------------------------------Infragistics.Shared.v3.2    Assembly Version: 3.2.20042.1111    Win32 Version: 3.2.20042.1111    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/Infragistics.Shared.v3.2.DLL----------------------------------------DevExpress.Data.v11.1    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.Data.v11.1.DLL----------------------------------------DevExpress.XtraEditors.v11.1    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.XtraEditors.v11.1.DLL----------------------------------------DevExpress.Utils.v11.1    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.Utils.v11.1.DLL----------------------------------------DevExpress.XtraGrid.v11.1    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.XtraGrid.v11.1.DLL----------------------------------------DevExpress.Printing.v11.1.Core    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.Printing.v11.1.Core.DLL----------------------------------------System.Data    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Xml    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------ADODB    Assembly Version: 7.0.3300.0    Win32 Version: 7.10.6070    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/ADODB.DLL----------------------------------------Infragistics.Win.UltraWinGrid.v3.2    Assembly Version: 3.2.20042.1111    Win32 Version: 3.2.20042.1111    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/Infragistics.Win.UltraWinGrid.v3.2.DLL----------------------------------------Infragistics.Win.UltraWinExplorerBar.v3.2    Assembly Version: 3.2.20042.1111    Win32 Version: 3.2.20042.1111    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/Infragistics.Win.UltraWinExplorerBar.v3.2.DLL----------------------------------------Accessibility    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll----------------------------------------System.Configuration    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------CrystalDecisions.CrystalReports.Engine    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.CrystalReports.Engine/13.0.2000.0__692fbea5521e1304/CrystalDecisions.CrystalReports.Engine.dll----------------------------------------CrystalDecisions.Shared    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Shared/13.0.2000.0__692fbea5521e1304/CrystalDecisions.Shared.dll----------------------------------------CrystalDecisions.ReportAppServer.CommLayer    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.CommLayer/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CommLayer.dll----------------------------------------CrystalDecisions.ReportAppServer.ClientDoc    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.ClientDoc/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.ClientDoc.dll----------------------------------------CrystalDecisions.ReportAppServer.Controllers    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.Controllers/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.Controllers.dll----------------------------------------CrystalDecisions.ReportAppServer.DataDefModel    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.DataDefModel/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.DataDefModel.dll----------------------------------------CrystalDecisions.ReportAppServer.DataSetConversion    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.DataSetConversion/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.DataSetConversion.dll----------------------------------------CrystalDecisions.ReportAppServer.CubeDefModel    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.CubeDefModel/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.CubeDefModel.dll----------------------------------------CrystalDecisions.ReportAppServer.ReportDefModel    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.ReportAppServer.ReportDefModel/13.0.2000.0__692fbea5521e1304/CrystalDecisions.ReportAppServer.ReportDefModel.dll----------------------------------------log4net    Assembly Version: 1.2.10.0    Win32 Version: 1.2.10.0    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/log4net/1.2.10.0__692fbea5521e1304/log4net.dll----------------------------------------System.Web    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll----------------------------------------CrystalDecisions.Shared.resources    Assembly Version: 13.0.2000.0    Win32 Version: 13.0.1.220    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/CrystalDecisions.Shared.resources/13.0.2000.0_en_692fbea5521e1304/CrystalDecisions.Shared.resources.dll----------------------------------------DevExpress.XtraCharts.v11.1    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.XtraCharts.v11.1.DLL----------------------------------------DevExpress.PivotGrid.v11.1.Core    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.PivotGrid.v11.1.Core.DLL----------------------------------------System.Management    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.42 (RTM.050727-4200)    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll----------------------------------------DevExpress.XtraScheduler.v11.1.Core    Assembly Version: 11.1.6.0    Win32 Version: 11.1.6.0    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/DevExpress.XtraScheduler.v11.1.Core.DLL----------------------------------------GMap.NET.WindowsForms    Assembly Version: 1.5.5.5    Win32 Version: 1.5.5.5    CodeBase: file:///C:/Program%20Files/BSL%20Complete/BSL%20Complete%20Runtime%206/GMap.NET.WindowsForms.DLL----------------------------------------
************** JIT Debugging **************To enable just-in-time (JIT) debugging, the .config file for thisapplication or computer (machine.config) must have thejitDebugging value set in the system.windows.forms section.The application must also be compiled with debuggingenabled.
For example:
<configuration>    <system.windows.forms jitDebugging="true" /></configuration>
When JIT debugging is enabled, any unhandled exceptionwill be sent to the JIT debugger registered on the computerrather than be handled by this dialog box.

Jul 23, 2011 at 3:54 PM

hm, can you try make a test app and only call System.Reflection.Assembly.LoadFile("c:\..\\..\..........\v73_NET2_x86\System.Data.SQLite.dll");

Jul 23, 2011 at 5:04 PM

Where should that go ? in the  SQLitePureImageCache.cs

Jul 23, 2011 at 5:12 PM

no in your test app, called ConsoleApplication, void Main { try{ Assembly.LoadFile(..); } catch(Exception e) { Console.WriteLine("error: " + e); Console.ReadLine(); } }

Jul 23, 2011 at 8:10 PM

Sorry, am back now.

I created the test console app. It works fine on my development machine, but when i deploy this

is the exception :

 

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken = b77a5c561934e089' failed.

 

The deployment machine is simply an empty VM machine, XP SP3, NET 2, NET 4

Jul 23, 2011 at 8:23 PM

hm, can you try add this before loading dll:

FileIOPermission filePerm = new FileIOPermission(FileIOPermissionAccess.Read, "C:\...........\System.Data.SQLite.dll");
filePerm.Assert();

Jul 23, 2011 at 8:46 PM

Yes, i thought of that also, but Still no joy,

this is the console app :

 

      Console.WriteLine("setting permissions")

      Try         

Dim fileperm As New System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.Read, "C:\Documents and Settings\Administrator\Local Settings\Application Data\GMap.NET\DllCache\v73_NET2_x86\System.Data.SQLite.dll") 

       fileperm.Assert()

      Catch ex As Exception         

Console.WriteLine("error setting read permissions " & ex.Message.ToString)     

End Try      Console.WriteLine("permissions set")


      Console.WriteLine("loading assembly")     

 

Try         System.Reflection.Assembly.LoadFile("C:\Documents and Settings\Administrator\Local Settings\Application Data\GMap.NET\DllCache\v73_NET2_x86\System.Data.SQLite.dll")     

Catch ex As Exception         

Console.WriteLine("error " & ex.Message.ToString)     

End Try     

 

Console.WriteLine("loaded")

      MsgBox("done")

 

This is the result :

 

setting permissions

permissions set

loading assembly

error Could not load file or assembly 'System.Data.SQLite, Version=1.0.73.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

loaded

 

 

Jul 23, 2011 at 8:58 PM

tried FileIOPermissionAccess.Unrestricted ?

Jul 23, 2011 at 9:09 PM

no,

 

But i looking in the events and in the system tab there are these 3 entries :

 

Generate Activation Context failed for C:\Documents and Settings\Administrator\Local Settings\Application Data\GMap.NET\DllCache\v73_NET2_x86\System.Data.SQLite.dll. Reference error message: The operation completed successfully.

 

Dependent Assembly Microsoft.VC90.CRT could not be found and Last Error was The referenced assembly is not installed on your system.

 

Resolve Partial Assembly failed for Microsoft.VC90.CRT. Reference error message: The referenced assembly is not installed on your system.

Jul 23, 2011 at 9:14 PM

sorry, yes, i did try   AllAccess,  i don't have   Unrestricted (NET 2 ?????)

the error is still there

are you able to distribute the console app on a virgin machine?

Jul 23, 2011 at 9:21 PM

try install this on your test machine http://www.microsoft.com/download/en/details.aspx?id=5582

Jul 23, 2011 at 9:32 PM

I got it working by installing this on the deployment machine .....

Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

But its another package to be loaded onto all machines now it seems.  This wasn't the case

before with your previous builds.

But at least it is working now,

Thanks again for your help.

Jul 23, 2011 at 9:52 PM
Edited Jul 23, 2011 at 9:53 PM

i wonder if it's the same with .NET4, i'll try to experiment and include required additional dlls by default or get rid of them somehow ;}, thanks for identifying the issue!

Jul 25, 2011 at 8:01 PM

done, should work anywhere without any configs

Jul 26, 2011 at 5:51 PM

Yes, can confirm is now working without the need for MS Visual C++ Package,

Good work.

Thanks.