Why the web.cofig file is very important (The Role Manager feature has not been enabled.)

Why the web.cofig file is very importent (The Role Manager feature has not been enabled.)


Remove the web config file:


When we remove the web config file then we get fallowing expection :

The Role Manager feature has not been enabled.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: The Role Manager feature has not been enabled.

Source Error: 
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

 Why the web.cofig file is very important:There are two main file :

  • machine.config
  • web.config


Every time we install the .NET framework, there is a machine.config file that is created in "C:\WINDOWS\Microsoft.NET\Framework\[Version]\CONFIG", which mainly defines:

  1. Supported configuration file sections,
  1. the ASP.NET worker process configuration, and
  1. registers different providers that are used for advanced features such as profiles, membership, and role based security.


Every web application inherits settings from the machine.config file, and application level setting is done in the web.config file. We can also override configurations in themachine.config file in the web.config file. 

But, a few settings can not be overridden because certain settings are process model settings and can't be changed on a per application basis.

For this reson we should create a web.confin file in web site which have all settings and configration information.


Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories. 

Configuration settings in a Web.config file can optionally be applied to individual files or subdirectories by specifying a path in a location element.


Other Post :


Comments