C# C WPF中的SQLiteConnection存在问题
我正在开发一个带有嵌入式SQLite数据库的C WPF项目。我以前使用过SQLite,没有任何问题,但出于某种原因,当我调用:C# C WPF中的SQLiteConnection存在问题,c#,wpf,sqlite,.net-3.5,system.data.sqlite,C#,Wpf,Sqlite,.net 3.5,System.data.sqlite,我正在开发一个带有嵌入式SQLite数据库的C WPF项目。我以前使用过SQLite,没有任何问题,但出于某种原因,当我调用: SQLiteConnection conn = new SqliteConnection("my connection string"); 但是,当执行此代码时,它会显示错误 XamlParserException未处理 无法创建程序集“MyProject”中定义的MainWindow.xaml的实例,版本=1.0.0.0。。。 调用的目标已引发异常。标记文件“Mai
SQLiteConnection conn = new SqliteConnection("my connection string");
但是,当执行此代码时,它会显示错误
XamlParserException未处理
无法创建程序集“MyProject”中定义的MainWindow.xaml的实例,版本=1.0.0.0。。。
调用的目标已引发异常。标记文件“MainWindow.xaml”第1行第9位出错
在这个位置是XAML文件中的以下代码
<Window xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" x:Class="MySQLBackup.MainWindow"
我已经将该项目设置为.Net Framework 3.5,因此我不明白为什么会出现此错误,以及为什么在调用类文件中的SQLiteConnection时,XAML会说这是一个错误
谢谢你能提供的帮助
更新
下面是stacktrace和内部异常
内部异常
System.Configuration.ConfigurationErrorsException:无法识别
配置部分userSettings/Gui.Properties.Settings。
C:\Users\Chris\AppData\Local\Microsoft\MySQLBackup.vshost.exe\u Url\u 5ar2cuyxbdeg3v0bx5aak4mgjx2jmsbn\1.0.0\user.config
第17行
System.Configuration.ConfigurationSchemaErrors.ThrowIfErrorsBoolean
无知的本地人
System.Configuration.BaseConfigurationRecord.ThrowifParseErrors配置方案错误
计划错误
System.Configuration.BaseConfigurationRecord.ThrowiFiniter位于
System.Configuration.ClientConfigurationSystem.OnConfigRemovedObject
发送方,InternalConfigEventArgs e
堆栈跟踪
在
System.Configuration.ClientConfigurationSystem.OnConfigRemovedObject
发件人,InternalConfigEventArgs位于
System.Configuration.Internal.InternalConfigRoot.OnConfigRemovedInternalConfigEventArgs
注视
System.Configuration.Internal.InternalConfigRoot.RemoveConfigImplString
configPath,BaseConfigurationRecord configRecord位于
System.Configuration.BaseConfigurationRecord.GetSectionRecursiveString
configKey,Boolean getLkg,Boolean checkPermission,Boolean
getRuntimeObject,布尔请求服务器,对象和结果,对象&
resultRuntimeObject位于
System.Configuration.BaseConfigurationRecord.GetSectionString
configKey、Boolean getLkg、Boolean checkPermission位于
System.Configuration.BaseConfigurationRecord.GetSectionString
配置键在
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IIInternalConfigSystem.GetSectionString
节名在
System.Configuration.ConfigurationManager.GetSectionString
节名在
System.Configuration.ClientSettingsStore.ReadSettingsString
sectionName,布尔值IsUserScope位于
System.Configuration.LocalFileSettingsProvider.GetPropertyValuesSettingsContext
上下文,设置属性集合属性位于
System.Configuration.SettingsBase.GetProperties from ProviderSettingsProvider
提供商位于
System.Configuration.SettingsBase.GetPropertyValueByNameString
System.Configuration.SettingsBase.get\u ItemString处的propertyName
propertyName位于
System.Configuration.ApplicationSettingsBase.GetPropertyValueString
propertyName位于
System.Configuration.ApplicationSettingsBase.get\u ItemString
propertyName位于
MySQLBackup.Properties.Settings.get_app_dbPassword in
c:\users\chris\documents\visual studio
2010\Projects\MySQLBackup\MySQLBackup\Properties\Settings.Designer.cs:line
43在MySQLBackup.SqlDatabaseWork..ctor中
c:\users\chris\documents\visual studio
2010\Projects\MySQLBackup\MySQLBackup\Logic\SqlDatabaseWork.cs:第25行
我已经设法解决了。我认为这与应用程序创建的user.config文件有关。我删除了user.config,然后告诉VisualStudio重新构建,然后它似乎开始工作了
感谢您的帮助您能显示异常的堆栈跟踪吗?此错误与SQLite无关。。。XamlParseException的InnerException是什么?我已经将异常和堆栈跟踪作为更新放在问题中