ASP.NET Web Site Admin tool & Custom Provider

Last post 11-22-2007 5:07 AM by toniboi. 4 replies.

Sort Posts:

  • ASP.NET Web Site Admin tool & Custom Provider

    11-20-2006, 10:43 AM
    • Member
      31 point Member
    • GreggTB
    • Member since 11-20-2006, 3:34 PM
    • Georgia, USA
    • Posts 9

    FYI: I did  

    I have written two custom providers for our Oracle 9i database...a Membershp provider and a Role provider. I've been testing these over the last few days and they seem to be working well. However, when I try to use the ASP.NET 2.0 Web Site Administration Tool in VS 2005, I get an error when I click on the "Create User" link.

    On the tool's Provider tab, I have selected to use my custom providers! Also, I do not seem to have a problem managing existing users or creating/managing roles. Nor do I have any problems when I programmatically create a new user using the "Membership.CreateUser()" method. The error only seems to occur when I try to use the "Create User" link via the ASP.NET 2.0 Web Site Administration Tool's Security tab.

    The following info is a portion of what's written to the Application Event Log:
    /**********************************/
    Exception information:
        Exception type: ConfigurationErrorsException
        Exception message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 120)
    /**********************************/

    In my application's WEB.CONFIG file, I have removed the default connection info for the "LocalSqlServer" connection. I have also added a <clear/> element under each provider as suggested in this post: http://forums.asp.net/thread/1291997.aspx.

    In the computer's MACHINE.CONFIG file, I do have an entry for the "LocalSqlServer" connection, as well as entries for the default AspNetSqlMembershipProvider, AspNetSqlProfileProvider and AspNetSqlRoleProvider providers. I've tried commenting out all of these entries but then I still get an error (although a different one) when I try to use the "Create User" link via the ASP.NET 2.0 Web Site Administration Tool's Security tab.

    Has anyone else encountered this error and know of a solution? Any ideas why this error occurs only via the one link in the ASP.NET 2.0 Web Site Administration Tool?

    I'd greatly appreciate any assistance with this issue. Thank you!

  • Re: ASP.NET Web Site Admin tool & Custom Provider

    11-20-2006, 2:15 PM
    • All-Star
      23,803 point All-Star
    • pkellner
    • Member since 11-12-2004, 10:42 AM
    • San Jose, California
    • Posts 3,567
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    I had troubles with the built in tool so wrote my own.  It's described and available in an MSDN article that can be found here:

    http://peterkellner.net/2006/01/09/microsoft-aspnet-20-memberrole-management-with-iis/ 

    Peter Kellner
    http://peterkellner.net
    Microsoft MVP • ASPInsider
  • Re: ASP.NET Web Site Admin tool & Custom Provider

    11-20-2006, 3:27 PM
    • Member
      31 point Member
    • GreggTB
    • Member since 11-20-2006, 3:34 PM
    • Georgia, USA
    • Posts 9

    Thanks for the response. I actually found your site and that particular article the other day while searching for a solution to my problems with the built-in web site admin tool. I would, however, prefer to find out what's causing this error. If it's a limitation of the VS.NET tool, then so be it but everything I've read suggests that custom providers (even non-SQL Server providers) are fully supported by the tool.

    Thanks again!
     

  • Re: ASP.NET Web Site Admin tool & Custom Provider

    11-26-2006, 2:15 PM
    • Contributor
      7,142 point Contributor
    • thuhue
    • Member since 09-18-2003, 9:54 AM
    • Posts 2,044
    I'm taking look at Peter's tool. But where's the other tool in VS2005 to install and access? All this is rather new to me. I would like to know both. Thanks.
    Please mark the post(s) that have helped you as "Answer"
  • Re: ASP.NET Web Site Admin tool & Custom Provider

    11-22-2007, 5:07 AM
    • Member
      47 point Member
    • toniboi
    • Member since 08-15-2007, 9:50 PM
    • Posts 32

    I've encountered this same problem just the other day. If you're using AspNetProvider and OracleProvider by switching to and from the other, then I'd suggest the following.

    I would get an error when I click the Create User link. When I go to Providers to select a provider for each feature, OracleMembershipProvider option was there but AspNetSqlMembershipProvider was not. In the Role Provider section, everything were okay. This shouldn't have happened if didn't experiment on the config files.

    I cannot exactly remember what I did but it would be something to do with machine.config and web.config files when I was trying to figure out the solution.

    Both membership providers must appear in machine.config file - the AspNetSqlMembershipProvider and the AspNetMembershipProvider.
    I tried using <clear /> but it wasn't necesssary here.

    The roles providers must also appear - OracleRoleProvider, AspNetSqlRoleProvider, AspNetWindowsTokenRoleProvider in the machine.config file.

    In your web.config file, you can specify a default membership provider (e.g. OracleMembershipProvider or AspNetSqlMembershipProvider). Like this one
    <membership defaultProvider="OracleMembershipProvider" />
    Nothing more, perhaps.

     In my understanding, using the <clear/> tag will clear all providers from the defined list before it uses the next-to-be-added provider/s.

Page 1 of 1 (5 items)