Asp. NET common standard configuration Web. config

Source: Internet
Author: User
Tags switches

In our project development process, we often want to configure the Wei.config file, and most of the time the configuration is similar, the following is a simple configuration, the other configuration can be added on this basis

<?xml version="1.0"encoding="Utf-8"?><configuration> <system.web> <!--Dynamic Debug Compilation Settings compilation Debug="true"to enable ASPX debugging. Otherwise, set this value tofalsewill improve the run-time performance of this application. Set compilation Debug="true"To Insert debug symbols (. pdb information) into the compilation page. Because this creates a large file that is slow to execute, you should set this value to only when you are debugging .true, and at all other times set tofalse.    For more information, see the documentation for debugging ASP. NET files. -<compilation DefaultLanguage="C #"Debug="true"/> <!--custom error message settings customErrors mode=" on"Or"RemoteOnly"To enable custom error messages, or set to"Off"to disable the custom error message. For each error to be processed, add<error>tags. " on"The custom (friendly) information is always displayed. "Off"Detailed ASP. NET error information is always displayed. "RemoteOnly"Displays custom (friendly) information only for users who are not running on the local Web server.    For security purposes, this setting is recommended so that the details of the application are not displayed to remote clients. -<customerrors mode="RemoteOnly"/> <!--Authentication This section sets an authentication policy for the application. The possible patterns are"Windows","Forms"、"Passport"And"None"          "None"no authentication is performed. "Windows"IIS performs authentication based on the settings of the application (basic, brief, or integrated Windows).          Anonymous access must be disabled in IIS. "Forms"you provide users with a custom form (a Web page) for entering credentials, and then verify their identity in your application.          The user credential token is stored in a Cookie. "Passport"authentication is performed through Microsoft's centralized authentication service, which provides a separate login and core profile service for member sites. -<authentication mode="Windows"/> <!--authorize this section to set the authorization policy for the application. You can allow or deny different users or roles access to application resources. Wildcard characters:"*"means anyone,"?"represents an anonymous (unauthenticated) user. -<authorization> <allow users="*"/> <!--allow all users-<!--<allow users="[comma-delimited list of users]"Roles="[comma-delimited list of roles]"/> <deny users="[comma-delimited list of users]"Roles="[comma-delimited list of roles]"/>-</authorization> <!--application-level trace logging application-level tracking enables trace log output for each page in the application. Set trace enabled="true"You can enable application tracking logging. If pageoutput="true", the trace information is displayed at the bottom of each page. Otherwise, you can browse the WEB application's root directory by browsing the"Trace.axd"page to view the application trace log. -<Trace Enabled="false"requestlimit="1"pageoutput="false"TraceMode="SortByTime"localonly="true"/> <!--session state settings by default, ASP. NET uses cookies to identify which requests belong to a particular session.         If the Cookie is not available, you can track the session by adding the session identifier to the URL. To disable cookies, set sessionstate cookieless="true". -<sessionstate mode="InProc"stateconnectionstring="tcpip=127.0.0.1:42424"sqlConnectionString="data source=127.0.0.1; Trusted_connection=yes"cookieless="false"Timeout=" -"/> <!--Globalization This section sets the globalization settings for the application. -<Globalization requestencoding="Utf-8"responseencoding="Utf-8"uiCulture="ZH-CN"Culture="ZH-CN"/> </system.web> <system.diagnostics> <switches> <add name="Logmanagerswitch"Value="4"/> </switches> <trace autoflush="true"Indentsize="4"> <listeners> <add name="Rollingfiletracelistener"Type="logmanagement.tracelisters.rollingfiletracelistener,logmanagement"initializedata="E:\\working\\jackworklog.log"/> </listeners> </trace> </system.diagnostics></configuration>

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.