Deploy a WPF application on a PC without installing Sqlite .net provider
I deployed a WPF application on a client PC but the application keeps crashing every time it tries to connect to the database (I'm using SQLite and cant use anything else) and since I can't debug it on the client PC, I can't be 100% sure of what's the problem.
My requirements are that I can't install any 3rd party executables, in this case I cant install (sqlite-netFx45-setup-x86-2012-1.0.90.0.exe) since the users will not have access to the machine's GAC, but it solved my problem when I tried it on a test machine.
What I've done so far:
add name="SQLite Data Provider" invariant="System.Data.SQLite" description="Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"
I already found the following solved question, but it did not work for me.
The connection string is: metadata=res:///Models.GreenPulseModel.csdl|res:///Models.GreenPulseModel.ssdl|res://*/Models.GreenPulseModel.msl;provider=System.Data.SQLite;provider connection string="data source=D:PATH TO DATABASEDBGreenPulseDb.db;datetimekind=Utc;foreign keys=True;password={PASSWORD} "" providerName="System.Data.EntityClient
This is the complete stack trace from the event viewer from the client PC:
Application: GreenPulse.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Configuration.ConfigurationErrorsException Stack: at System.Data.Common.DbProviderFactories.GetFactory(System.Data.DataRow) at System.Data.Common.DbProviderFactories.GetFactory(System.String) at System.Data.EntityClient.EntityConnection.GetFactory(System.String) at System.Data.EntityClient.EntityConnection.ChangeConnectionString(System.String) at System.Data.EntityClient.EntityConnection..ctor(System.String) at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(System.Configuration.ConnectionStringSettings) at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(System.String, System.Data.Entity.Internal.AppConfig) at System.Data.Entity.Internal.LazyInternalConnection.Initialize() at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySe tAndBaseTypeForType(System.Type) at System.Data.Entity.Internal.Linq.InternalSet1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Initialize() at System.Data.Entity.Internal.Linq.InternalSet1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetEnumerator() at System.Data.Entity.Infrastructure.DbQuery1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Collections.Generic.IEnumerable.GetEnumerator() at System.Collections.Generic.List1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable1) at System.Linq.Enumerable.ToList[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089] at MUC.Data.Infrastructure.Repository.GenericRepository2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089] ,[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetAll() at MUC.Orion.WPFTemplate.DataServices.Repositories.InvoiceRepository.GetInvoiceHolders() at MUC.Orion.WPFTemplate.DataServices.DataManager.GetInvoiceHolders() at MUC.Orion.WPFTemplate.BusinessServices.BusinessManager.GetInvoiceHolders() at MUC.Orion.WPFTemplate.Presentation.ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel.PopulateInvoiceHolders() at MUC.Orion.WPFTemplate.Presentation.ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel..ctor() at DynamicClass.ctor(System.Object) at MUC.Core.Reflection.Emitter.ConstructorInvoker.Invoke(System.Delegate) at MUC.Core.Reflection.Emitter.EmitterBase.Execute[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089] at MUC.Core.Reflection.Reflector.Construct(System.Type, System.Type[], System.Object[]) at System.TypeExtensions.Construct(System.Type, System.Type[], System.Object[]) at MUC.Core.Wpf.F actories.ViewFactory.CreateView(System.String, Boolean, System.Object[]) at MUC.Core.Wpf.Services.Navigation.NavigationService.NavigateTo(System.String, Boolean, Boolean, System.Object[]) at MUC.Core.Wpf.Services.Navigation.Navigator.NavigateTo(System.String, Boolean, Boolean, System.Object[]) at MUC.Core.Wpf.Controls.Desktop.DesktopManager.ResolveContext(System.String) at MUC.Core.Wpf.Controls.Desktop.DesktopManager.RegisterDesktop(MUC.Core.Wpf.Controls.Desktop.Desktop) at MUC.Orion.WPFTemplate.ViewModels.ShellViewModel.OpenDesktop(System.Object) at MUC.Core.Wpf.Commands.ActionCommand1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnExecute(System.__Canon) at MUC.Core.Wpf.Commands.CommandBase1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Execute(System.__Canon) at MUC.Core.Wpf.Commands.CommandBase1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e0 89]].System.Windows.Input.ICommand.Execute(System.Object) at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource, Boolean) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object) at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean) at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windo ws.RoutedEvent) at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object) at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean) at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs) at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs) at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs) at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPt r, IntPtr) at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(System.Object) at System.Windows.Application.RunInternal(System.Windows.Window) at System.Windows.Application.Run(System.Windows.Window) at System.Windows.Application.Run() at MUC.Orion.WPFTemplate.App.Main()
I'm not sure if missed something.
Any help will be appreciated. Thanks in advance.
链接地址: http://www.djcxy.com/p/72708.html