Major configuration elements have been moved to the machine.config file in .NET 4

May 25, 2010 12:44 GMT  ·  By

With the advent of the latest iteration of Microsoft’s development platform and tools, the company took a number of steps designed to result in optimized desktop and Cloud applications for devs, simply by leveraging Visual Studio 2010 and .NET Framework 4. An illustrative example in this regard is the new Web.config file that can accompany ASP.NET 4.

Because of the tweaks introduced in .NET Framework 4, Microsoft has simplified web.config files that are created alongside blank ASP.NET websites and projects. Essentially, developers will be able to see that the files contain only basic information.

“The Web.config file that contains the configuration for a Web application has grown considerably over the past few releases of the .NET Framework as new features have been added, such as Ajax, routing, and integration with IIS 7. This has made it harder to configure or start new Web applications without a tool like Visual Studio. In .the NET Framework 4, the major configuration elements have been moved to the machine.config file, and applications now inherit these settings. This allows the Web.config file in ASP.NET 4 applications either to be empty or to contain just the following lines, which specify for Visual Studio what version of the framework the application is targeting,” Microsoft explained.

In the video embedded at the bottom of this article, you will be able to watch Microsoft’s Joe Stagner explain the chances for the Web.config file in ASP.NET 4 applications. Because all of the major configuration elements previously associated with the web.config file have now been transitioned to the machine.config file, blank ASP.NET 4 applications will come with a configuration file featuring only a minimum number of lines.

Previously “configuration information for ASP.NET resources is contained in a collection of configuration files, each named Web.config. Each configuration file contains a nested hierarchy of XML tags and subtags with attributes that specify the configuration settings,” the Redmond company explained.

Visual Studio 2010 Premium is available for download here. Visual Studio 2010 Professional is available for download here. Visual Studio 2010 Ultimate is available for download here. Visual Studio Test Professional 2010 is available for download here.

.NET Framework 4 RTM is available for download here.

Install Silverlight