Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:20:54+00:00 2026-06-14T14:20:54+00:00

I want to use the role management asp.net, but Visual Studio keeps creating the

  • 0

I want to use the role management asp.net, but Visual Studio keeps creating the ASPNETDB.MDF file all the time, and I don’t need this. I already have an existing database file which I want to use instead of the ASPNETDB.MDF. This is mainly for denying unnecessary directory listing for unwanted users.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:20:55+00:00Added an answer on June 14, 2026 at 2:20 pm

    You can get rid of the ASPNETDB.MDF – an extraneous attached database file, and can store all your security information (users, roles) inside your custom SQL Database.

    Follow these simple steps

    Step 01 – Create Security Tables in Your SQL Database

    First, you need to create tables that will hold ASP.NET security information inside your SQL database. There is a wizard for that.

    ASP.NET SQL Server Setup Wizard is located (Windows XP and Windows 2008 Server):

    %WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

    ASP.NET SQL Server Setup Wizard is located (Windows 7 x64) in one of those:

    %WinDir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe
    %WinDir%\ Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe
    %WinDir%\Microsoft.NET\Framework64\v2.0.50727 \aspnet_regsql.exe
    %WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

    This self-guided wizard is very simple. You pick your SQL Server (usually .\SQLExpress) and desired database and the wizard will create all required tables and objects to handle ASP.NET security inside your custom SQL database.

    Step 02 – Generate a Machine Key

    Passwords inside security tables are store encrypted. You need to generate and record your unique machine key inside web.config file.

    Visit http://aspnetresources.com/tools/machineKey and get a ready unique machine key neatly wraped in a few lines of code, ready for your web.config. Generate your lines and place them inside XML element:

    ... <machineKey
          validationKey="6B6DC7FF0657AEE33FEB36189072D99551F27E281EAEEC8B0516B188A85CF2E4C
                         4A988429765C625979A232B5BE78D6E52CB59C3675B44FCA032C24B2C49DC5"
          decryptionKey="CFED70360D049F182EA009258C34ED698A799774A2687AAE94098C71C6BF38C8"
          validation="SHA1"
          decryption="AES" />
    </system.web>
    

    Step03 – Modify Your web.config

    Modify your web.config to include membership, roles and profile providers.

    Place code similar to these lines bellow inside XML element. Replace word “Your” with an appropriate name, matching your naming conventions.

    …

    <membership defaultProvider="YourMembershipProvider">
      <providers>
        <add connectionStringName="YourConnectionString" applicationName="/"
           enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false"
           requiresUniqueEmail="true" passwordFormat="Encrypted"     maxInvalidPasswordAttempts="5"
           passwordAttemptWindow="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"
           name="YourMembershipProvider" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>
    
    <roleManager enabled="true" cacheRolesInCookie="true" cookieName="YOUR_ROLES" defaultProvider="YourRoleProvider">
      <providers>
        <add connectionStringName="YourConnectionString" applicationName="/" name="YourRoleProvider"
          type="System.Web.Security.SqlRoleProvider" />
       </providers>
     </roleManager>
    
     <profile defaultProvider="YourProfileProvider">
        <providers>
           <add name="YourProfileProvider" connectionStringName="YourConnectionString"
          applicationName="/" type="System.Web.Profile.SqlProfileProvider" />
         </providers>
     </profile>
    

    Now you can run ASP.NET Configuration inside Web Developer or Visual Studio and make sure that all new users are created inside your custom database, and not in /App_Data/ASPNETDB.MDF

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to ASP.net MVC and I want to use a view but with
I want use a single php file to handle all of my voting requests.
i want to implement asp.net role provider to assign users over my LAN to
I have made the database using ASP.Net Configuration(aspnet_regsql.exe tool) . I want to use
i want to use asp.net membership provider for my own database i have own
I want to use NauckIT asp.net membership provider for Postgres. I was playing with
I have an ASP.NET application running on shared hosting and want to use Windows
I'm new to the ASP.NET world. Since I want to use the ORM it
I want to use ASP.NET Membership Provider with Windows Authentication and Membership Roles. I
I want to use the role back feature yet when I write the tag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.