IIS - fixing allowDefinition='MachineToApplication' error

Asked By Brandon Schave on 18-May-12 01:24 PM
Hi,

I am new to IIS 7 and I cannot seem to get my .NET application to run on my local machine. I have an application with two sitemap files. when I try to run my application on my local I get the following 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."

The line it points to is:
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">

how do I fix this?
LIJO PHILIP replied to Brandon Schave on 18-May-12 11:51 PM
Delete the  project backup sub directory. that is the cause of the problem 
LIJO PHILIP replied to Brandon Schave on 18-May-12 11:56 PM

also you can move the location of the Obj folder to C:\Temp\BUILD. You have to do it per csproj file, but it is a great solution.  


Check this link to do so

http://stackoverflow.com/questions/261422/visualstudio-how-to-save-the-obj-folder-somewhere-else 

dipa ahuja replied to Brandon Schave on 20-May-12 02:29 PM
For IIS :
Change authentication mode to 'None' in web.config.

Go to your web.config file and change following line
<authentication mode="None" />
 
For Visual Studio :
The error is coming because you are opening your website incorrectly...

open the site where the web.config file is at root directory

if you are opening site where web.config file is inside some folder like  websites(where web.config is inside website folder):

Websites:website1:web.config  //Gives you this error so open the site like "website1"

website1:web.config

or try this link:
<http://blogs.msdn.com/b/robgruen/archive/2005/09/12/464196.aspx>
 
hope you get it