ASP. NET custom membership provider part.4 (using a custom provider class)

Source: Internet
Author: User
ArticleDirectory
    • 1. Use wat for debugging

Create a web applicationProgramTo test previous user-defined member providers and role providers.

In the Web. config file, configure Form Verification and set the custom provider correctly (or set it in ASP. NET wat). For example:

 
<System. Web>

<Authentication Mode= "Forms" />

<Authorization>

<Deny Users= "? "/>

</Authorization>

<Compilation Debug= "True" Targetframework= "4.0" />

<Membership Defaultprovider= "Xmlmembership">

<Providers>

<Add Name= "Xmlmembership" Applicationname= "Testprovider"

Filename= "D: \ testprovider \ users. config" Requiresquestionandanswer= "True"

Type= "Skysoot. providers. xmlmembershipprovider, skysoot. providers"/>

</Providers>

</Membership>

<Rolemanager Enabled= "True" Defaultprovider= "Xmlroles">

<Providers>

<Add Name= "Xmlroles" Applicationname= "Testprovider" Filename= "D: \ testprovider \ roles. config"

Type= "Skysoot. providers. xmlroleprovider, skysoot. providers"/>

</Providers>

</Rolemanager>

</System. Web>

These providers are set to absolute file names and path values. If the relative path is used, the provider tries to create a configuration file in the working directory of the Web server. If your Web account does not have the permission to access this folder, this will cause an exception.

 

With this configuration, you can also find these providers in ASP. NET wat:

 

You can also create some roles for testing the website. Of course, you need to set the authorization in the web. config file:

 

1. Use wat for debugging

To debug through Wat, you only need to start Wat, select "debug"> "attach to process" in Vs, and then select the corresponding web server process. In most cases, when a file-based Web server is used, two processes run, you need to add it to the correct port to use the WAT debugging provider (the port number can be viewed in the browser address bar ).

When you operate Wat, the breakpoint set in the program will be hit correctly, as shown below:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.