'System.Windows.Navigation.BaseUriHelper'的类型初始值设定项引发了异常

时间:2013-08-06 08:43:58

标签: c# wpf app-config

在VS2012,WPF项目中,添加连接字符串后,出现错误

'System.Windows.Application'的类型初始值设定项引发了异常

'System.Windows.Navigation.BaseUriHelper'的类型初始值设定项引发异常

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <connectionstrings>
      <add connectionstring="Data Source=x.x.x.x; User Id=sa;Password=abc; Initial Catalog=hello;" name="ConString"/>
    </connectionstrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>

1 个答案:

答案 0 :(得分:2)

connectionString,大写 S

<connectionStrings>相同。资本 S

XML区分大小写。