Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 初始化字符串的格式不符合从索引0(MVC)开始的规范_Asp.net Mvc_Entity Framework_Iis_Webdeploy_Windows Server 2012 R2 - Fatal编程技术网

Asp.net mvc 初始化字符串的格式不符合从索引0(MVC)开始的规范

Asp.net mvc 初始化字符串的格式不符合从索引0(MVC)开始的规范,asp.net-mvc,entity-framework,iis,webdeploy,windows-server-2012-r2,Asp.net Mvc,Entity Framework,Iis,Webdeploy,Windows Server 2012 R2,现在在任何事情之前,我必须向你们保证这不是因为错误的连接字符串,我已经检查和测试了多次 这是一个众所周知的问题,很多人建议“更正”连接字符串,但显然这不是我的解决方案。 我使用VS2013 Web Deploy工具将我的Asp.NET MVC应用程序部署到iis,安装在我从OVH(加拿大)购买的Windows 2012R2服务器上 下面是web.config文件: > <?xml version="1.0" encoding="utf-8"?> <configuratio

现在在任何事情之前,我必须向你们保证这不是因为错误的连接字符串,我已经检查和测试了多次

这是一个众所周知的问题,很多人建议“更正”连接字符串,但显然这不是我的解决方案。 我使用VS2013 Web Deploy工具将我的Asp.NET MVC应用程序部署到iis,安装在我从OVH(加拿大)购买的Windows 2012R2服务器上

下面是web.config文件:

> <?xml version="1.0" encoding="utf-8"?> <configuration>  
> <configSections>
>     <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="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TakeOutMaster;User
> Id=TakeOutMaster;Password=TakeOutMaster"
> providerName="System.Data.SqlClient" />
>     <add name="DefaultConnection_DatabasePublish" connectionString="DefaultConnection_DatabasePublish.ConnetionString"
> 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>
>     <authentication mode="None" />
>     <compilation targetFramework="4.5.1" />
>     <httpRuntime targetFramework="4.5.1" />
>         <machineKey decryptionKey="8D764AB26980185F882E96A9E35C32593F1DFA124BE2C65E"
> validationKey="CE57D7D27468AC41982F44B71625B1513A1BCDDBC2B2084F3F1D68D618F095BFD53B3A76613AF7E7F5C1518D869DB1FB5F70053B82901DCF539D5103D274FC2D"
> validation="SHA1"/>   </system.web>   <system.webServer>
>     <modules>
>       <remove name="FormsAuthentication" />
>     </modules>   </system.webServer>   <runtime>
>     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
>       <dependentAssembly>
>         <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
>         <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
>       </dependentAssembly>
>       <dependentAssembly>
>         <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
>         <bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
>       </dependentAssembly>
>     </assemblyBinding>   </runtime>   <entityFramework>
>     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory,
> EntityFramework" />
>     <providers>
>       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices,
> EntityFramework.SqlServer" />
>     </providers>
>     <contexts>
>       <context type="TakeOutMaster.Models.ApplicationDbContext, TakeOutMaster">
>         <databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[TakeOutMaster.Models.ApplicationDbContext,
> TakeOutMaster], [TakeOutMaster.Migrations.Configuration,
> TakeOutMaster]], EntityFramework, PublicKeyToken=b77a5c561934e089">
>           <parameters>
>             <parameter value="DefaultConnection_DatabasePublish" />
>           </parameters>
>         </databaseInitializer>
>       </context>
>     </contexts>   </entityFramework> </configuration>

有什么想法吗,伙计们?我已经花了一整天的时间,仍然坚持…

删除你的第二个连接字符串(DefaultConnection\u DatabasePublish)看看它是否有效,你测试了哪一个,两个都测试了吗?我确实删除了,但没有任何帮助!还有其他想法吗?!删除你的第二个连接字符串(DefaultConnection\u DatabasePublish)看看它是否有效,你测试了哪一个,两个都测试了吗?我确实删除了,但没有任何帮助!还有其他想法吗?!删除你的第二个连接字符串(DefaultConnection\u DatabasePublish)看看它是否有效,你测试了哪一个,两个都测试了吗?我确实删除了,但没有任何帮助!还有其他想法吗?!
format of the initialization string does not conform to specification starting at index 0