Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: "Connection name 'LocalSqlServer' was not found" error when try to browse domain  (Read 2734 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
Getting "Connection name 'LocalSqlServer' was not found" error when try to browse domain in browser
Code: [Select]
Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.
 Source Error:       
    Line 255:    <roleManager>
    Line 256:      <providers>
    Line 257:        <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=34657f7f11d50a3a" />
    Line 258:      </providers>

    Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config    Line: 257

How to solve this?
  • Make a copy of the file C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
  • Open this file in notepad.exe and find string that begins from . It should look similar to example:
<connectionStrings>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

  • If you see that there is no connection string tag in machine.config, try to add it similar to example above.