1

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.

Community
  • 1
  • 1
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    Are you sure *"This error can be caused by a virtual directory not being configured as an application in IIS."* doesn't apply in your case? It's hard to tell without seeing your IIS structure. – Filburt Feb 27 '17 at 23:29
  • 1
    More than likely you have another web.config in one of your directories wether virtual or not. This is the kind of error that would occur if you are compying project file from one solution to another as the references have not all been updated and thus you have hidden 'virtual' directories – DaniDev Feb 27 '17 at 23:51
  • Now that I got through that, I'm back to having this problem: http://stackoverflow.com/questions/42496323/how-can-i-get-ie-to-recognize-my-default-page – B. Clay Shannon-B. Crow Raven Feb 27 '17 at 23:55

1 Answers1

1

Yes, I saw that Filburt was bloodhounding the problem after I figured it out. I had to go to IIS, select the folder beneath the site, and then right-click that and select "Convert to Application" - then the build error went away.

I had previously done that just for the site itself, but not for the folder beneath it. So if doing it for the site has no effect, why is it afforded?

To be plain to future sufferers/questers after a solution to this irritating conundrum, here is a screenshot of the site in question, in IIS 7.5:

enter image description here

So, "Converting to Application" of EMS did nothing; but "Converting to Application" of "customerreportingnet" did.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862