在PC上部署WPF应用程序而不安装Sqlite .NET提供程序
我在客户端PC上部署了一个WPF应用程序,但每次尝试连接数据库时应用程序都会崩溃(我正在使用SQLite并且无法使用其他任何东西),并且因为我无法在客户端PC上进行调试,所以我可以不能100%确定问题所在。
我的要求是我无法安装任何第三方可执行文件,在这种情况下,我无法安装(sqlite-netFx45-setup-x86-2012-1.0.90.0.exe),因为用户无法访问机器的GAC,但它解决了我在测试机器上试用时遇到的问题。
到目前为止我所做的:
add name="SQLite Data Provider" invariant="System.Data.SQLite" description="Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"
我已经找到了以下解决的问题,但它不适合我。
连接字符串是: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 DATABASE DB GreenPulseDb.db; datetimekind = Utc; foreign keys = True; password = {PASSWORD}”“providerName =”System.Data.EntityClient
这是来自客户端PC的事件查看器的完整堆栈跟踪:
应用程序:GreenPulse.exe Framework版本:v4.0.30319说明:由于未处理的异常,进程已终止。 异常信息:System.Configuration.ConfigurationErrorsException堆栈:在System.Data.Common.DbProviderFactories.GetFactory(System.Data.DataRow)在System.Data.Common.DbProviderFactories.GetFactory(System.String)在System.Data.EntityClient.EntityConnection System.Data.EntityClient.EntityConnection.ChangeConnectionString上的.GetFactory(System.String)System.Data.EntityClient.EntityConnection..ctor(System.String)上System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting上System.Data(System.String) (System.Configuration.ConnectionStringSettings)System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(System.String,System.Data.Entity.Internal.AppConfig)System.Data.Entity.Internal.LazyInternalConnection.Initialize()System .Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()at System.Data.Entity.Internal.InternalContext.GetEntitySe System.Data.Entity.Internal.Linq.InternalSet1 [[System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]]上的tAndBaseTypeForType(System.Type)。 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 ]在MUC.Data.Infrastructure.Repository.GenericRepository2 [[系统.__ Canon,mscorlib,版本= 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089] ,[System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]]。MUC.Orion.WPFTemplate.DataServices.Repositories.InvoiceRepository.GetInvoiceHolders()的GetAll()位于MUC.Orion.WPFTemplate。 MUC.Orion.WPFTemplate.BusinessServices.BusinessManager.GetInvoiceHolders()上的DataServices.DataManager.GetInvoiceHolders()。MUC.Orion.WPFTemplate.Presentation上的MUC.Orion.WPFTemplate.Presentation.ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel.PopulateInvoiceHolders()上的DataInvoiceHolders()。 ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel..ctor()在MUC.Core.Reflection.Emitter.ConstructorInvoker.Invoke(System.Delegate)在DynamicClass.ctor(System.Object)在MUC.Core.Reflection.Emitter.EmitterBase.Execute System上的MUC.Core.Reflection.Reflector.Construct(System.Type,System.Type [],System.Object [])中的[System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089] .Mex.Core.Wpf.F上的.TypeExtensions.Construct(System.Type,System.Type [],System.Object []) (MUC.Core.Wpf.Services.Navigation.NavigationService.NavigateTo(System.String,Boolean,Boolean,System.Object [])上的actories.ViewFactory.CreateView(System.String,Boolean,System.Object [])。 Core.Wpf.Services.Navigation.Navigator.NavigateTo(System.String,Boolean,Boolean,System.Object [])在MUC.Core.Wpf.Controls.Desktop.DesktopManager.ResolveContext(System.String)位于MUC.Core。在MUC.Orion.WPFTemplate.ViewModels.ShellViewModel.OpenDesktop(System.Object)位于MUC.Core.Wpf.Commands.ActionCommand1的Wpf.Controls.Desktop.DesktopManager.RegisterDesktop(MUC.Core.Wpf.Controls.Desktop.Desktop)[ [System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]] .Mac.Core.Wpf.Commands.CommandBase1 [System .__ Canon,mscorlib,Version = 4.0 .0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089]]。执行(System .__ Canon)在MUC.Core.Wpf.Commands.CommandBase1 [[System .__ Canon,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e0 System.Windows.Controls.Primitives.ButtonBase上的MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource,Boolean)中的System.Windows.Input.ICommand.Execute(System.Object)。 System.Windows.Controls.Button.OnClick()在System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)在System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object,System .Windows.Input.MouseButtonEventArgs)在System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate,System.Object)在System.Windows.RoutedEventHandlerInfo System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate,System.Object)。在System.Windows.EventRoute.InvokeHandlersImpl(System.Object,System.Windows.RoutedEventArgs,Boolean)上的System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject,System.Value)中的InvokeHandler(System.Object,System.Windows.RoutedEventArgs) Windows.RoutedEventArgs,System.Windo wsRoutedEventArgs)System.Windows.UIElement.OnMouseUpThunk(System.Object,System.Windows.Input.MouseButtonEventArgs)System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate,System.Object)System.Windows.RoutedEventArgs .InvokeHandler(System.Delegate,System.Object)在System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object,System.Windows.RoutedEventArgs)在System.Windows.EventRoute.InvokeHandlersImpl(System.Object,System.Windows.RoutedEventArgs,Boolean )在System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject,System.Windows.RoutedEventArgs)在System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)在System.Windows.UIElement.RaiseEvent(System.Windows。 System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)System.Windows.Input.InputProviderSite.ReportInput(System.Windows。)中System.Windows.Input.InputManager.ProcessStagingArea()上的RoutedEventArgs,布尔) Input.InputReport)at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr,MS)System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr,System.Windows.Input.InputMode,Int32,System.Windows.Input.RawMouseActions,Int32,Int32,Int32) IntPtr,Int32,IntPtr,IntPtr,IntPtr,Boolean ByRef) ,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.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,System.Object,System.Delegate,System.Object, Int32)at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPt r,IntPtr)在System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)在System.Windows.Threading.Dispatcher的MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)。在System.Windows.Threading.Dispatcher.Run()System.Windows.Application.RunDispatcher(System.Object)System.Windows.Application.RunInternal(System.Windows.Window)上的PushFrame(System.Windows.Threading.DispatcherFrame) System.Windows.Application.Run(System.Windows.Window)at System.Windows.Application.Run()at MUC.Orion.WPFTemplate.App.Main()
我不确定是否漏掉了一些东西。
任何帮助将不胜感激。 提前致谢。
链接地址: http://www.djcxy.com/p/72707.html上一篇: Deploy a WPF application on a PC without installing Sqlite .net provider
下一篇: MySQL Session state provider crashes on expired sessions