在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>
答案 0 :(得分:2)
connectionString,大写 S
与<connectionStrings>
相同。资本 S
XML区分大小写。