Now before anything, I must assure you guys this is not because of the wrong connection string, I have checked and tested it multiple times!
So here it goes, apparently this is a well known issue and a lot of people suggest to "correct" the connection string, but obviously that's not the solution in my case. I have used the VS2013 Web Deploy tool to deploy my Asp.NET MVC app to iis, on a Windows 2012R2 server I have bought from OVH (Canada).
So here is the web.config file:
> <?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>
When I try the app on the server, I get the following error:
format of the initialization string does not conform to specification starting at index 0
Any idea folks? I have spent my whole day and still stuck...