J
Juan T. Llibre
re:
You can include web.config in any directory, as long as
that web.config doesn't include any MachineToApplication
configurations, if the directory isn't a virtual directory.
See my just-sent reply.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
Juan --
So we're saying the same thing, then? That I'll run into problems if I
include Web.config in any directory besides the root, AND has not been
configured as a virtual directory? And _that_ is what the
MachineToApplication error indicates?
-= Tek Boy =-
I'll run into problems if I include Web.config in any directory besides the root,
AND has not been configured as a virtual directory?
You can include web.config in any directory, as long as
that web.config doesn't include any MachineToApplication
configurations, if the directory isn't a virtual directory.
See my just-sent reply.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
Juan --
So we're saying the same thing, then? That I'll run into problems if I
include Web.config in any directory besides the root, AND has not been
configured as a virtual directory? And _that_ is what the
MachineToApplication error indicates?
-= Tek Boy =-
re:Are Web.config files only allowed in virtual directory and IIS website root directories?
You can include a web.config file in every directory you have in your app.
The only warning is that you can't include MachineToApplication configurations
in web.config files in directories which haven't been configured as virtual directories.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
Ok, I've made a bit of progress. Before I go into the explanation,
here's my directory structure:
C:\...\tinkering\ (set up as a virtual directory:
http://localhost/tinkering/)
======================================================
\tinkering\GeneralFunctionsAttempt01\
\tinkering\GeneralFunctionsAttempt01\Default.aspx
\tinkering\GeneralFunctionsAttempt01\Default.aspx\Default.aspx.cs
\tinkering\GeneralFunctionsAttempt01\Web.config
\tinkering\FirstPage.aspx
\tinkering\FirstPage.aspx\FirstPage.aspx.cs
\tinkering\Global.asax
\tinkering\Tinkering.sln
\tinkering\Web.config
======================================================
I was trying to run the ASPX script at
http://localhost/tinkering/FirstPage.aspx, so I had opened the
directory in Visual Studio .NET 2005 (File > Open Web Site >
[C:\...\tinkering\] ). When I tried to compile everything (F5), errors
were raised. However, once I excluded
[\tinkering\GeneralFunctionsAttempt01\Web.config] from the project,
everything recompiled again. My guess is that I created the
[GeneralFunctionsAttempt01] project a few days ago, then created the
[FirstPage.aspx] project in the parent folder -- and that might have
caused problems.
Including [\tinkering\GeneralFunctionsAttempt01\Web.config] still
causes compiling [\tinkering] to fail. Are Web.config files only
allowed in virtual directory and IIS website root directories?
-= Tek Boy =-
A day or two ago, I wrote a quick ASPX page with a CS codebehind using
Visual Studio .NET 2005 -- it worked, I saved it and closed the
project. Today, I came back to the project, reopened the solution, and
was greeted with 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.
========================================================================
I did some searching on Google, and all of the solutions to this
problem involved tweaking IIS. The thing is, I didn't have to touch
IIS when I wrote, compiled and ran the ASPX the first time around --
why would I have to do it during a subsequent visit?
If anybody has any suggestions on how to resolve this problem, I would
greatly like to hear them. Thanks in advance!
-= Tek Boy =-