Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在PC上部署WPF应用程序而不安装Sqlite.net提供程序_C#_.net_Sqlite_System.data.sqlite - Fatal编程技术网

C# 在PC上部署WPF应用程序而不安装Sqlite.net提供程序

C# 在PC上部署WPF应用程序而不安装Sqlite.net提供程序,c#,.net,sqlite,system.data.sqlite,C#,.net,Sqlite,System.data.sqlite,我在客户端PC上部署了一个WPF应用程序,但每次尝试连接到数据库时,该应用程序都会崩溃(我使用的是SQLite,不能使用其他任何东西),而且由于我无法在客户端PC上调试它,我无法100%确定问题出在哪里 我的要求是,我不能安装任何第三方可执行文件,在这种情况下,我不能安装(sqlite-netFx45-setup-x86-2012-1.0.90.0.exe),因为用户将无法访问机器的GAC,但当我在测试机器上尝试时,它解决了我的问题 到目前为止我所做的: 将System.Data.SQLite

我在客户端PC上部署了一个WPF应用程序,但每次尝试连接到数据库时,该应用程序都会崩溃(我使用的是SQLite,不能使用其他任何东西),而且由于我无法在客户端PC上调试它,我无法100%确定问题出在哪里

我的要求是,我不能安装任何第三方可执行文件,在这种情况下,我不能安装(sqlite-netFx45-setup-x86-2012-1.0.90.0.exe),因为用户将无法访问机器的GAC,但当我在测试机器上尝试时,它解决了我的问题

到目前为止我所做的:

  • 将System.Data.SQLite.dll和System.Data.SQLite.Linq.dll设置为复制本地
  • 我在App.Config(system.data->dbProviderFactorys)中注册了ADO.Net提供程序,如下所示
  • 我还将应用程序设置为以管理员身份运行
我已经找到了以下已解决的问题,但它对我不起作用

  • 连接字符串为:元数据=res:///Models.GreenPulseModel.csdl|res:///Models.GreenPulseModel.ssdl|res://*/Models.GreenPulseModel.msl;provider=System.Data.SQLite;提供程序连接字符串=“数据源=D:数据库路径\DB\GreenPulseDb.DB;datetimekind=Utc;外键=True;密码={password}”“提供程序名称=“System.data.EntityClient”

    这是来自客户端PC的事件查看器的完整堆栈跟踪:

    应用程序:GreenPulse.exe框架版本:v4.0.30319说明:由于未处理的异常,进程已终止。异常信息:System.Configuration.ConfigurationErrorsException堆栈:位于System.Data.Common.DbProviderFactorys.GetFactory(System.Data.DataRow)的System.Data.Common.DbProviderFactorys.GetFactory(System.String)的System.Data.EntityClient.EntityConnection.GetFactory(System.String)位于System.Data.EntityClient.EntityConnection.ChangeConnectionString(System.String)处的System.Data.EntityClient.EntityConnection..ctor(System.String)处的System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionString设置(System.Configuration.ConnectionString设置)位于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()在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()在System.Data.Entity.InternalContext.GetEntitySetAndBaseTypeForType(System.Type)在System.Data.Entity.Internal.Linq.InternalSet1[[System.\uu Canon,mscorlib,Version=4.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]]上初始化()在System.Data.Entity.Internal.Linq.InternalSet1[[System.\uu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]]GetEnumerator()在System.Data.Entity.Infrastructure.DbQuery1[[System.\uu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A561934E089]]System.Collections.Generic.IEnumerable.GetEnumerator()位于System.Collections.Generic.List1[[System.\uu Canon,mscorlib,Version=4.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]…ctor(System.Collections.Generic.IEnumerable1)位于System.Linq.Enumerable.ToList在MUC.Data.Infrastructure.Repository.GenericRepository2[[System.\uuu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089],位于MUC.Data.Infrastructure.Repository2[[System.\uu Canon,mscorlib,Version=4.0.0.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089],[System.\uu Canon,mscorlib,Version=4.0.0,Culture=neutral,PublicKeyToken=B77A561934E089]。GetAll位于MUC.Orion.WPFTemplate.DataServices.Repositories.InvoiceRepository.GetInvoiceHolders()位于MUC.Orion.WPFTemplate.DataServices.DataManager.GetInvoiceHolders()位于MUC.Orion.WPFTemplate.BusinessServices.BusinessManager.GetInvoiceHolders()处位于MUC.Orion.WPFTemplate.Presentation.ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel.PopulateInvoiceHolders(),位于MUC.Orion.WPFTemplate.Presentation.ViewModels.Impl.InvoiceHolders.HolderSelectorViewModel.ctor(),位于MUC.Core.Reflection.Emitter.ConstructorInvoker.Invoker(System.Delegate)的DynamicClass.ctor(System.Object)处在MUC.Core.Reflection.Emitter.EmitterBase.Execute[System.\u Canon,mscorlib,Version=4.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]在MUC.Core.Reflection.Reflector.Construct(System.Type,System.Type[],System.Object[])在System.typextensions.Construct(System.Type,System.Type[],System.Object[])上执行在MUC.Core.Wpf.Services.Navigation.NavigationService.NavigateTo(System.String,Boolean,Boolean,System.Object[])在MUC.Core.Wpf.Services.Navigation.NavigateTo(System.String,Boolean,Boolean,System.Object[])在MUC.Core.Wpf.Services.Navigation.Navigator.NavigateTo(System.String,Boolean,Boolean,System.Object[])位于MUC.Core.Wpf.Controls.Desktop.DesktopManager.ResolveContext(System.String)位于MUC.Core.Wpf.Controls.DesktopManager.RegisterDesktop(MUC.Core.Wpf.Controls.Desktop.Desktop)位于MUC.Orion.WPFTemplate.ViewModels.ShellViewModel.OpenDesktop(System.Object)位于MUC.Core.Wpf.Commands.ActionCommand1[[System.\uu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089].OneExecute(System.\uu Canon)在MUC.Core.Wpf.Commands.CommandBase1[[System.\uu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]]执行(System.\uu Canon)在MUC.Core.Wpf.Commands.Commands.CommandBase1执行[[System.\uu Canon,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089].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()