Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Server Error in '/' Application" error?

Tags:

asp.net

I am trying to deploy an asp.net application in our server while I am receiving 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.
Source Error: 
Line 63:             ASP.NET to identify an incoming user. 
Line 64:         -->
Line 65:                  <authentication  mode="Windows"/>
Line 66:                  <!--<forms loginUrl="~/SCR.UI/Login1.aspx"/>
Line 67:                  </authentication>-->
Source File: D:\BarclaysPayamentManagementSystem\scr.ui\web.config    Line: 65

What is the reason and how to resolve it?

Please help


like image 996
priyanka.sarkar Avatar asked Jun 30 '09 11:06

priyanka.sarkar


People also ask

Why does my computer say server error?

A server error can be caused by any number of things from uploading the incorrect file to as bug in a piece of code. This error response is a generic "catch-all" response. The web server is telling you that something went wrong, but it's not sure exactly what that is.


4 Answers

You may get this error when trying to browse an ASP.NET application.

The debug information shows that "This error can be caused by a virtual directory not being configured as an application in IIS."

However, this error occurs primarily out of two scenarios.

  1. When you create an new web application using Visual Studio .NET, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

To resolve it, right click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the text box. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.

  1. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or session state is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly, we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unauthorized users).

like image 79
Árvíztűrő tükörfúrógép Avatar answered Sep 19 '22 00:09

Árvíztűrő tükörfúrógép


I had this error when the .NET version was wrong - make sure the site is configured to the one you need.

See aspnet_regiis.exe for details.

like image 39
Dror Avatar answered Sep 20 '22 00:09

Dror


I had this error with VS 2015, in my case going to the project properties page, Web tab, and clicking on Create Virtual Directory button in Servers section solved it

like image 34
mohas Avatar answered Sep 21 '22 00:09

mohas


It sounds like the admin has locked the "authentication" node of the web.config, which one can do in the global web.config pretty easily. Or, in a nutshell, this is working as designed.

like image 45
Wyatt Barnett Avatar answered Sep 17 '22 00:09

Wyatt Barnett