IIS Application Required?

  • Thread starter Thread starter Andy Sutorius
  • Start date Start date
A

Andy Sutorius

Hi,

Do you always have to make a folder an application if you have a web.config
in that folder?


Thanks,

Andy
 
Do you always have to make a folder an application if you have a web.config
in that folder and the web.config has Forms Authentication?
 
Yes. Or a virtual directory. Or the root of you website.

This might be different if you are developing on Web Matrix as it has it's
own built-in webserver..but for VS.Net development or for production on IIS,
yes.

Karl
 
Do you always have to make a folder an application if you have a
web.config

No. Only if you want to run an ASP.Net app in it. ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
You can get away without having to make the app run within a virtual
directory if you exculde the <authentication> , and <sessionState> elements
in the web.config file. There are others but these elements are put in the
web.config file by default by VS.NET. These 2 tags along with a couple others
can only be defined at the application level. So, this is why the virtual
directory is needed to use Forms Authentication
 
Actually, in spite of Karl and Kevin's opinions
to the contrary, you do *not* need to make a
folder an application, nor even a virtual directory,
in order to run a web.config in that directory.

All that's needed is for the directory to be a sub-directory
of an application, and you *will* be able to run a web.config
file in that directory which establishes rules for that sub-dir.

What you *cannot* do is, in a directory's web.config,
make application-level changes. Local changes which
modify the way the application reacts to requests *within*
that sub-directory are fine.

You could have a zillion directories,
and a zillion web.configs i each sub-dir,
all running under *one* application root.




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=====================
 
You're correct, Juan. I was only partially correct, in that the web itself
needs to be configured as an application, but a sub-directory of that
application can contain a web.config and not be configured as a separate app
(and in fact, in many cases, SHOULD not be). Thanks for clearing that up!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
This is along the same lines but maybe you can help me figure our what went
wrong. I came across a issue last week where I had a folder under my wwwroot
with a few aspx pages and I tried to run one of the pages and I got an error
that IIS could not load the type of the page. ie. It would not load my .dll
from my bin directory. However, if I made it a virtual directory then the
pages ran just fine. So, in that senario, is a virtual directory necessary
for those aspx files to run?

BTW. I didn't had any web.config file in that folder..because I didn't
need it
 
re:
I got an error that IIS could not load the type of the page.
ie. It would not load my .dll from my bin directory.
However, if I made it a virtual directory then the
pages ran just fine. So, in that scenario, is a virtual
directory necessary for those aspx files to run?

Absolutely. You need a virtual directory if the /bin
directory below the directory where the files are
located is going to work.

If you're running .aspx pages from a directory which
hasn't been made a virtual directory or an ASP.NET app,
then the /bin directory below /wwwroot will be the directory
where the page will look for the assembly.




Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=====================
 
YOU ROCK MAN! Some books don't explain this clearly. I have always wondered
about this. See, this is what you get when vs.net does everything for you.
Ah well, I still can't live without it! :-)
 
Back
Top