0

When I build my application in visual studio, I am getting below error:

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. C:\Users\application\Web.Config 195

However, at line 195 of web.config, I don't have anything for allowDefinition section. I guess this is because there may be another web.config in system which is getting inherited here. I tried to search in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config but nothing is mentioned for allowDefinition attribute.

I tried old web.config but still getting the same error.

TechTurtle
  • 2,667
  • 4
  • 22
  • 31

1 Answers1

0

In my case, I tried going to the folder and deleted all the obj and bin folders.

Or click Convert to Application in IIS Manager

Also try deleting the web.config, try creating a new one.

Finally check <MvcBuildViews>true</MvcBuildViews>

Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21