views:

123

answers:

4

I have an asp.net application of type web site. I keep getting the error below in VS 2008. The site works fine from a browser.I have made every folder using IIS manager an asp.net app. Why does it keep complaining? The site's folder is below a parent folder. I am not familiar with web site apps instead of web application app. Where are the options to use IIS or the internal web server like WAP has?

"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"

A: 

This error can occur when you are you redefining stuff in the web.config of your virtual directory that you cannot override. Such as authentication or sessionstate. Try deleting all web.configs in your virtual directories to see if that solves the problem.

zwanz0r
A: 

I dealed a lot with this error when having more than one web.config in the same virtual web directory / website. It may happen if you make a temporary backup of your website for example. Could you verify it?

jdecuyper
I have a folder under wwwroot. This folder has two subfolders. Each host a website project with its own web.config. In VS 2008 the two folders show up as folders but each site gives the same error. My workaround is to copy each site in its own folder under wwwroot. It works but now the two sites are not under source control anymore so when I am done with editing, I have to copy for these sites back to the original project and check in.
Tony_Henrich
Hi Tony! If I understand correctly, you have both projects versioned on the same SVN trunk. I would recommend having two separate repositories for both projects althought you may have a good reason for this. Let us know.
jdecuyper
A: 

You likely have a virtual directory set up as a real site, having a bin directory, aspnet_client and web.config.

Either remove those and run it as a relative path, localhost\subdir\default.aspx, or create a new website in IIS to point directly at it.

cdm9002
I don't have any virtual directory. These are folders under a parent folder and they were set up to be application enabled using IIS manager.
Tony_Henrich
A: 

My workaround was to move each folder into its own folder under wwwroot.

Tony_Henrich