locked
IIS Config and VS deployment RRS feed

  • Question

  • User1068737495 posted

    `I had a hard drive crash and need to reinstall everything in the Windows 7 dev environment, running Visual Studio 2010 and IIS 7, with .NET 4.x. IIS is configured with Basic and Windows authentication.

    When I debug my code in Visual Studio, everything works, but when accessing from the client I get the following error.

    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

    The code is a backup from prior to HD crash, and it was working just fine. The error shows at SessionState timeout line, but if I remove the line, it will appear elsewhere. The virtual directo4ry is configured.

    I have searched around, but not found a solution. Any help would be greatly appreciated.

    Thanks.

    Monday, April 17, 2017 12:27 PM

All replies

  • User-1315512054 posted

    Hello,

    You could check your ASP.NET version which is configured to be used on the IIS. Also, you could check your permissions (full trust), because when you execute the site via VS you have admin rights, but in IIS you have the application pool user rights.

    Regards

    Tuesday, April 18, 2017 5:21 AM
  • User-2057865890 posted

    Hi omsoft,

    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

    The above error message indicates that there is a Web.config file in one of the website's subfolders than has one of these configuration elements that cannot be defined beyond the application level. Just Remove this Subfolder web.config from Subfolder. Check this blog. You could also try deleting the bin and obj folders, run a Clean Solution and Build it again.

    Best Regards,

    Chris

    Tuesday, April 18, 2017 5:36 AM