title: How to deploy ASP.NET website with SQL Server database (membership enabled) in Godaddy using VS2013
body: <p>I know this question is already answered but none solve my problem, I maybe having certain unknown issue. So I am again asking this question. Please help…. thanks in advance.</p>
  
  <p>I am using Visual Studio 2013 update 3. I have developed an ASP.NET web application with membership enabled that uses the <code>LocalDb</code> provided by VS2013. I have published the website to GODADDY web server but I am not able to deploy the database. Without the database my application is working fine. I have created my SQL Server database in the GODADDY server. I am using the <code>Build -&gt; Publish</code> option available in VS2013.</p>
  
  <p>My <code>web.config</code> file is as </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="entityFramework" 
               type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" 
           connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-WebTest-20150416011010.mdf;Initial Catalog=aspnet-WebTest-20150416011010;Integrated Security=True" 
           providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
    &lt;system.web&gt;
      &lt;authentication mode="None"/&gt;
      &lt;compilation debug="true" targetFramework="4.5.2"/&gt;
      &lt;httpRuntime targetFramework="4.5"/&gt;
      &lt;customErrors mode="Off"/&gt;
      &lt;trust level="Full"/&gt;
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Optimization"/&gt;
          &lt;add namespace="Microsoft.AspNet.Identity"/&gt;
        &lt;/namespaces&gt;
        &lt;controls&gt;
          &lt;add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
      &lt;membership&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;profile&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/profile&gt;
      &lt;roleManager&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
      &lt;sessionState mode="InProc" customProvider="DefaultSessionProvider"&gt;
        &lt;providers&gt;
          &lt;add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/&gt;
        &lt;/providers&gt;
      &lt;/sessionState&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;httpErrors errorMode="Detailed"/&gt;
      &lt;asp scriptErrorSentToBrowser="true"/&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="mssqllocaldb"/&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My <code>web.Release.config</code> file as </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"&gt;     
      &lt;connectionStrings&gt;
          &lt;add name="DefaultConnection"
               connectionString="Data Source=xxx.xxx.xxx.xxx; Initial Catalog=mydatabase; User ID=username; Password=password"
               xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
      &lt;/connectionStrings&gt;  
      &lt;system.web&gt;
          &lt;compilation xdt:Transform="RemoveAttributes(debug)" /&gt;    
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>