Whenever you created an asp.net website using VWD or Visual studio (Which worked perfectly) and then tried run the same site through IIS (Internet Information Server) you may encounter the following error:-
Server Error in ‘/’ Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Almost all the asp.net programmers would have met the above error once in their life time. The solution to this is to convert the website folder into an application in IIS because asp.net files cannot be executed like the classic ASP.
Converting Virtual Directory into an Application.
1. If you had placed your website folder in the wwwroot folder of your system then,
2. Open the IIS from the programs menu and locate the website folder, this located under the default website node.
3. Right click on this website folder and select properties.
4. This will open your website properties window.
5. Select the directory tab and click the create button in the Application Settings section. Now you can see the application name field enabled and your website converted into an application.
6. Click OK.
7. Test your website in the Internet Explorer by entering http://localhost/mysitename
8. Your site should work fine, if not you may have some other problem.