`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.
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
WindowsHostingASP.NET - My favourite site for ASP.NET hosting information.
HowtoASP.NET - Free ASP.NET tutorials with examples and source code.
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.
Member
4 Points
40 Posts
IIS Config and VS deployment
Apr 17, 2017 12:27 PM|omsoft|LINK
`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.
Star
11650 Points
3462 Posts
Re: IIS Config and VS deployment
Apr 18, 2017 05:21 AM|HostingASPNet|LINK
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
HowtoASP.NET - Free ASP.NET tutorials with examples and source code.
All-Star
17652 Points
3510 Posts
Re: IIS Config and VS deployment
Apr 18, 2017 05:36 AM|Chris Zhao|LINK
Hi omsoft,
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