title: Problem with SQLiteConnection in C# WPF
body: <p>I am developing a C# WPF project with an embedded SQLite Database. I have used SQLite before without problems but for some reason when I call:</p>
  
  <pre><code>SQLiteConnection conn = new SqliteConnection("my connection string");
  </code></pre>
  
  <p>However, when this code executes it displays the error</p>
  
  <blockquote>
    <p>XamlParserException was unhandled
    Cannot create instance of MainWindow.xaml defined in assembly 'MyProject', Version=1.0.0.0...
    Exception has been thrown by the target of an invocation. Error in markup file 'MainWindow.xaml' Line 1 position 9. </p>
  </blockquote>
  
  <p>At this position is the following code in the XAML file</p>
  
  <pre><code>&lt;Window xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"  x:Class="MySQLBackup.MainWindow"
  </code></pre>
  
  <p>I have set the project to be .Net Framework 3.5 so I do not understandw why I am getting this error and why it is saying it is an error in the XAML when it calls the SQLiteConnection in the class file. </p>
  
  <p>Thanks for any help you can provide. </p>
  
  <p><strong>UPDATE</strong>
  As requested below is the stacktrace and inner exception</p>
  
  <p>Inner Exception</p>
  
  <blockquote>
    <p>System.Configuration.ConfigurationErrorsException: Unrecognized
    configuration section userSettings/Gui.Properties.Settings.
    (C:\Users\Chris\AppData\Local\Microsoft\MySQLBackup.vshost.exe_Url_5ar2cuyxbdeg3v0bx5aak4mgjx2jmsbn\1.0.0.0\user.config
    line 17)    at
    System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean
    ignoreLocal)    at
    System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors
    schemaErrors)    at
    System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()    at
    System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object
    sender, InternalConfigEventArgs e)</p>
  </blockquote>
  
  <p>Stacktrace</p>
  
  <blockquote>
    <p>at
    System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object
    sender, InternalConfigEventArgs e)    at
    System.Configuration.Internal.InternalConfigRoot.OnConfigRemoved(InternalConfigEventArgs
    e)    at
    System.Configuration.Internal.InternalConfigRoot.RemoveConfigImpl(String
    configPath, BaseConfigurationRecord configRecord)    at
    System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
    configKey, Boolean getLkg, Boolean checkPermission, Boolean
    getRuntimeObject, Boolean requestIsHere, Object&amp; result, Object&amp;
    resultRuntimeObject)    at
    System.Configuration.BaseConfigurationRecord.GetSection(String
    configKey, Boolean getLkg, Boolean checkPermission)    at
    System.Configuration.BaseConfigurationRecord.GetSection(String
    configKey)    at
    System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String
    sectionName)    at
    System.Configuration.ConfigurationManager.GetSection(String
    sectionName)    at
    System.Configuration.ClientSettingsStore.ReadSettings(String
    sectionName, Boolean isUserScoped)    at
    System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext
    context, SettingsPropertyCollection properties)    at
    System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider
    provider)    at
    System.Configuration.SettingsBase.GetPropertyValueByName(String
    propertyName)    at System.Configuration.SettingsBase.get_Item(String
    propertyName)    at
    System.Configuration.ApplicationSettingsBase.GetPropertyValue(String
    propertyName)    at
    System.Configuration.ApplicationSettingsBase.get_Item(String
    propertyName)    at
    MySQLBackup.Properties.Settings.get_app_dbPassword() in
    c:\users\chris\documents\visual studio
    2010\Projects\MySQLBackup\MySQLBackup\Properties\Settings.Designer.cs:line
    43    at MySQLBackup.SqlDatabaseWork..ctor() in
    c:\users\chris\documents\visual studio</p>
    
    <p>2010\Projects\MySQLBackup\MySQLBackup\Logic\SqlDatabaseWork.cs:line 25</p>
  </blockquote>