I am getting this err msg when I try to Rebuild a 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.
It refers to this line in Web.config:
<authentication mode="Windows"/>
According to the accepted and highly upvoted answer here, this problem occurs when there are multiple Web.config files, but my website has just this one.
If I simply comment out the offen[ding,sive] line, I get the same err msg when trying to rebuild, but on another line in the Web.config file, namely this one:
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60"/>
And so I think this will be a "whack-a-mole" if I keep it up, and eventually the effect of commenting out things will have some other malevolency, and thus this is untenable. What can I do to rectify this?
BTW, I did convert the site to an app in IIS.
