2

I am getting the following error when I am trying to build my website,

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 am using IIS express for my website and created a virtual directory and mapped in to a directory. Just found out since I have not mapped the virtual directory to an application it gives this error message. I cannot remove the virtual directory When I try to remove it from my website project.

My question is do I have to do anything else to remove the virtual directory from my web site project.

Joshua
  • 2,275
  • 7
  • 41
  • 57

2 Answers2

0

Try to set the Virtual Directory to be an application under IIS as per the instructions in the accepted answer here. Furthermore, make sure that your web.config for your project is being created in the root of your application (so that a config file from further up the tree is not being applied instead).

Community
  • 1
  • 1
Miika L.
  • 3,333
  • 1
  • 24
  • 35
0

I came across this error a while ago..

Make sure your web.config is placed at the top level of the project folders. Also its best to make sure you don't have multiple versions of them

Hope this helps

PhilNerd

Phil
  • 463
  • 3
  • 9
  • Thanks, Since I am using IIS express I had to remove the entry for virtual folder from applicationhost.config file. Now its working fine. I was waiting to update my solution as an answer and have to wait for some hours. – Joshua Apr 04 '12 at 13:12