Link to home
Start Free TrialLog in
Avatar of najh
najhFlag for United Kingdom of Great Britain and Northern Ireland

asked on

In IIS7, when you add a new web SITE, is that the same as adding a new application too?

I'm trying to get an understanding of what's going wrong with my website development now I'm using IIS7.  Every answer I've had to questions on here this week has tended to leave me none the wiser or at worst pointed me to a website rather than answer the actual question directly, so I'm hoping this one will work out better...

So to the question: when I add a website to IIS7, is that new website automatically a new application too? (e.g. a root application?) If not, then what is it? Or how am I meant to structure a new web site?

(P.S - I still have some other open questions that I'd like answers to, do look at those if you can help!)
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Yes, if you create a new site then IIS will automatically make it an application too, and assign it to the default application pool.
hello,

basically all of the web sites you add are applications when they are created. they run under an application pool which have a .net version.  

I think you are confused by this:
a web application, for example an asp.net application is something that contains code files and a web.config file. Web.config file is equivalent to app.config file of an application. I think you see it necessery to have these files for the website to be counted as an application.

No, in IIS 7 you do not need to have code under the website for it to be an application.

For example: if you do not have a home.aspx file but you wish to open the file http://localhost/home.aspx file, you will see an error page. this alone is a proof that a website running under IIS 7 is a website.
Avatar of najh

ASKER

Right, so when I have trouble with getting this 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.

and i don't have any virtual directories in my website and people tell me to convert my site to an application, what do they mean? If it's already an application then why would it need converting?

All I really want to do is have a website with a certain part of that site being under forms authentication control, but not all of it.  Just a bit - and that could be a page or a directory (I don't mind which).  But as soon as I try i start getting bogged down in these same errors, and the advice I always get seems to revolve around converting the website into an application.  Why would people tell me to do this if websites already are applications?
Do you have a web.config in a sub directory of your site?
ASKER CERTIFIED SOLUTION
Avatar of jkofte
jkofte
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of najh

ASKER

I'm not trying to put all my code and web.config files into a specific folder - just wherever they'd naturally go.

I have a web.config file in the root, yes.  And it does indeed run just fine.
 User generated imageSo here's a website (called MENU) and it has a folder in it called "test". I can access stuff in the root and in the test folder without any problems. There's a web.config in the root and there's also one in the test folder.  (the one in the test folder is used to specify what the default documents are - nothing more)

I've added an aspx file into the "test" folder called PrivateStuff.aspx.  I'd like to be able to use Forms authentication to control who can access that.  As soon as I try doing that, I get my error that I quoted above.  How would you add such authentication?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of najh

ASKER

ooo this sounds promising!  let me try some stuff first...
basically you can use the web.config file under the root of your application to configure properties (authorization etc.) of every folder in that application. you do not need to define web.config file for each of the folders in your application.

delete the web.config file in test folder, and add this to the web.config file under menu application. (inside configuration tag in web.config)

<location path="test">
		<system.web>
			<authorization>
				<deny users="?"/>
			</authorization>
		</system.web>
	</location>

Open in new window

Avatar of najh

ASKER

Thanks to you both.  You both said things which really helped me clear up some of the issues I've been having!