Error in Machine.config file?

Discussion in 'ASP.NET / ASP.NET Core' started by aatif786, Apr 3, 2008.

  1. Hey guys,
    This is my first time deploying an ASP.NET application, and am getting an error that doesn't make any sense to me. What I don't understand, is that the error source file points to a C: drive. Is it my C:drive? That doesn't make any sense to me. Here are some of the details:

    HOW TO REPLICATE ERROR:

    -Visit www.mohammedaatifali.com
    -This loads 'Default.aspx'

    SOFTWARE:
    I am using Visual Studio 2008. For local development, I am using a virtual directory with IIS Web Server and can access and run my project, called SSO, fine locally with this address http://localhost/sso'. I also used the Build->Publish SSO option to upload files to the ftp server.

    HERE IS THE ERROR MESSAGE:

    Server Error in '/' Application.
    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

    Source Error:

    Line 158: <roleManager>
    Line 159: <providers>
    Line 160: <add name='AspNetSqlRoleProvider' connectionStringName='LocalSqlServer' applicationName='/' type='System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'/>
    Line 161: <add name='AspNetWindowsTokenRoleProvider' applicationName='/' type='System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'/>
    Line 162: </providers>


    Source File: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config Line: 160

    Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434
     
  2. Hey thanks for the reply,
    And after a couple of hours of googling the answer is to add these 2 lines:

    <remove name='LocalSqlServer'/>

    <add name='LocalSqlServer' connectionString='Data Source=.\sqlexpress;Initial Catalog=mydb;Integrated Security=True' providerName='System.Data.SqlClient'/>


    I still don't understand why I need to redefine this connection string even though I am not using a SQL Server Database.

    Anyway, cheers and thanks for the help!!

    -Mohammed Aatif Ali
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    Because the default membership/ profile provider is configured to use "localSQLServer" connection string but the connection string is not configured.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. It's looking foryour local SQL Server Express Membership roles.
    Look in the Database section of these forums and you'll find some tips we've been posting.
    If you need more help with this let me know.
    Salute,
    Mark
     

Share This Page