Asp.net mvc 用户代码asp.net mvc未处理argumentexception
我在阅读Adam Freeman的pro asp.net mvc 5书籍时遇到了问题。当我尝试开始调试时,我发现错误: System.Data.dll中出现“System.ArgumentException”类型的异常,但未在用户代码中处理其他信息:关键字不受支持:“initialcatalog”。但my Web.config与本书中的不同。 屏幕:[1]: My Web.config代码:Asp.net mvc 用户代码asp.net mvc未处理argumentexception,asp.net-mvc,Asp.net Mvc,我在阅读Adam Freeman的pro asp.net mvc 5书籍时遇到了问题。当我尝试开始调试时,我发现错误: System.Data.dll中出现“System.ArgumentException”类型的异常,但未在用户代码中处理其他信息:关键字不受支持:“initialcatalog”。但my Web.config与本书中的不同。 屏幕:[1]: My Web.config代码: <?xml version="1.0" encoding="utf-8"?> <
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="EFDbContext" connectionString="Data Source=(localdb)\v11.0; InitialCatalog=SportsStore; Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
请注意,对不起,我的谷歌翻译英语。请尝试在连接字符串中添加空格,如下所示:
Initial Catalog=SportsStore;
你能展示一下书中的连接字符串吗?