简体   繁体   中英

Configuration error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

I have developed a web application using c# and asp.net but when I am trying to publish and put it into the server using ftp then I am getting this following error:

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 File: \\fs8-n02\stor10wc2dfw1\555713\570520\www.gxxxxjjsxx.ssd\web\content\2way\armb
              \web.config    Line: 9 

Here if I check on my Line 9 of the web config file then I get this:

  <authentication mode="Forms">

And here is my complete web config file code:

     <?xml version="1.0"?>

     <configuration>
     <system.web>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx" timeout="2880"/>
    </authentication>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <pages validateRequest="false">
      <controls>
        <add tagPrefix="ajaxtoolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolKit" />
      </controls>
    </pages>
    <globalization culture="en-GB"/>
  </system.web>
  <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
  </appSettings>
</configuration>

I have checked whether I have multiple web config files but I could not find something like that. And also I have used this published folder into my IIS and I can browse the site from my localhost using IIS but still when ever I am trying to browse using the link :

I am getting the same error. Please help me on this. Thanks.

Here is my solution to the problem: Actually the path was not configured properly into the IIS as a virtual directory. So, that I had to create a proper virtual directory and then only I am able to access the site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM