Web.config file is used to make the settings to a web application, whereas Machine.config file is used to make settings to all ASP.NET applications on a server(the server machine).
Yes, in fact this is the best place to store the connection string information.
Web.config is used for web based asp.net applications whereas app.config is used for windows based applications.
Off: Indicates that session state is not enabled.
Inproc: Indicates that session state is stored locally.
StateServer: Indicates that session state is stored on a remote server.
SQLServer: Indicates that session state is stored on the SQL Server.
You should configure exception management settings within your application’s Web.config file. The following is an example of the exception settings in a Web.config file.
< customErrors defaultredirect=”http://hostname/error.aspx” mode=”On”/>
< error statuscode=”500″ redirect=”/errorpages/servererror.aspx” />
< error statuscode=”404″ redirect=”/errorpages/filenotfound.htm” />
In the customErrors element, specify a default redirect page. There are three modes for the default redirect page:
Unhandled exceptions will redirect the user to the specified defaultredirect page. This is used mainly in production.
Users will see the exception information and not be redirected to the defaultredirect page. This is used mainly in development.
Only users accessing the site on the local machine (using localhost) will see the exception information while all other users will be redirected to the defaultredirect page. This is used mainly for debugging.
In addition to the default redirect page, you can set specific pages for certain HTTP error codes. For example, you can specify that all 404 errors result in a certain error page, while all 500 errors result in another
This is automatically installed when you install Visual Studio. Net.
This is also called machine level configuration file.
Only one machine.config file exists on a server.
This file is at the highest level in the configuration hierarchy.
This is automatically created when you create an ASP.Net web application project.
This is also called application level configuration file.
This file inherits setting from the machine.config
Web.config file defines configuration for a web project. Using “AppSetting” section we can define user-defined values.