0

I am developing two ASP.NET web application for the first time, but both works on local machine but give error on web server when hosted. I have searched a lot but haven't get any solution. Please help me.

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.

Also, in my first web application, all the pages are working fine on local machine as well as web server, but in the login page, after entering wrong ID and password, It shows the message "Wrong userid or password", but on entering correct Id and password, it gives the same error as mentioned above.

And all pages of my second web application work fine on local machine but give same error as mentioned above.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325

1 Answers1

0

The contents of the web.config in the subdirectory should be placed in the root directory. The configuration in the subdirectory is making IIS treat the subdirectory as the application root but it is not the application root. This is why you get the error allowDefinition='MachineToApplication'.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
Genish Parvadia
  • 1,437
  • 3
  • 17
  • 30