Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

allowDefinition='MachineToApplication' - MVC3 ERROR

I'm developing an application in MVC3 (http://www.colombiatrolley.com/sitrolley). In my computer it runs correctly, but when I upload it to the server (a hosting service) I get this 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.

I know it is a very common error but I have not fixed it yet.

Error capture

like image 630
Miguel Jiménez Avatar asked Mar 01 '12 03:03

Miguel Jiménez


2 Answers

Some config sections are only allowed at the "root" of the application, then authentication section is one of them.

You need to configure IIS to run your your site as an application, not a sub-directory in an existing application.

For IIS 7+, right click the directory that contains your web application, and select "Convert to Application".

EDIT:

Arie van Someren is right. Looking carefully at your error, you want the <authentication> configuration to be in the web.config one level up, not the web.config in Views.

like image 158
vcsjones Avatar answered Oct 17 '22 00:10

vcsjones


I had the same problem. I solved it by deleting the obj folder that appeared after doing a "Build > Publish".

like image 23
Tarzan Avatar answered Oct 16 '22 22:10

Tarzan