Richard
Richard

Reputation: 1106

Error:beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS

I inherited this application from a developer who no longer with the company. After I get latest and run the app, I get the following 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 170:  <location path="winLogin.aspx">
Line 171:    <system.web>
Line 172:      <authentication mode="Windows" />
Line 173:      <authorization>
Line 174:        <allow users="*" />

The error mentions IIS however since this is a VS 2005 project I am using the default web browser.

Any ideas on how to resolve?

Upvotes: 1

Views: 6873

Answers (2)

mellamokb
mellamokb

Reputation: 56779

I don't believe you can define

<authentication mode="Windows" />

inside of a <location> because that is an application-level setting. In other words, you can't use different authentication modes for different web pages in the same application. You will need to define this in the main <system.web> section of your configuration file instead.

The error message is just referring to one possible source of the error. Usage of any application-level setting inside of a <location> tag or in a child web.config file in a subfolder of an application root will generate this error message as well.

If you truly need multiple authentication methods, you can create a subfolder as a virtual application and define it there, for example, /winLogin/Default.aspx page controlled by configuration settings in /winLogin/web.config.

Update

Are you sure you can’t? I just checked the QA web site where this app is running fine and the Web.config has the following entries:

<location path="winLogin.aspx">
    <system.web>
      <authentication mode="Windows" /> 
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>

The problem I am having is on my dev / local machine

Upvotes: 1

Deb
Deb

Reputation: 991

I suggest you check your application folder.

Either there is a backup copy of the application within the your application root folder.

or you have a duplicate Web.config file somewhere within the application.

Another thing you should do is go to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and delete all folders related to your application name. If it is your development box then you can delete everything under this folder.

Hope this will fix the issue.

Upvotes: 0

Related Questions