Multiple applications/multiple web.configs: how to structure a big collection of (seemingly) nested

G

Guest

I'm seeking (probably basic) guidance on the right way to split a large site
that's supposed to represent one domain(mydomain.org) into many small VS.NET
projects, and how to avoid issues with multiple web.config files leading to
the error: "It is an error to use a section registered as allowDefinition =
'MachineToApplication'"...

I'm fairly new to VS.NET and my sloppy first solution was to make one huge
solution/project with just one web.config. My development got very slow due
to long compile times. It has become clear to me that this is not the right
way to work with VS.NET and compiled web applications. I need guidance for
how other professionals structure a large collection of related web
applications and deploy that properly on IIS.

One thing that led me to make the
huge-single-project-and-solution-with-just-one-web.config was issues I had
had in the past when I nested a web.config file past a root directory. It
led to errors such as ""It is an error to use a section registered as
allowDefinition = 'MachineToApplication'"..."

What I need is
a) To be able to develop and deploy many web applications that are nested
from the user's/URLs point of view, e.g.:
http://mydomain.org/FirstPublication
http://mydomain.org/FirstPublication/PhotoWebApplication
http://mydomain.org/FirstPublication/PhotoWebApplication/SpecializedImageApplication

b) To be able to develop those web applications as small projects so that
they compile very quickly.

c) To be able to have them reference my common ORM class framework. At the
just-concluded Tech Ed 2007 a very smart guy from Singapore named Boon
taught me how to compile my ORM as a seperate class library and reference it
from other projects. I think that's the solution right there, and I write it
here for the benefit of other folks using EntitySpaces and other ORMs and
who are wondering how to address slow compile times.

d) To avoid the dreaded error: ""It is an error to use a section registered
as allowDefinition = 'MachineToApplication'"..."

As I was drinking my morning coffee it occured to me that maybe the way out
of this problem was through IIS and IIS's use of virtual paths when I
deploy: a "flat" directory structure might be translatable into a directory
structure that apper as nested to the user (e.g.
http://mydomain.org/FirstPublication/PhotoWebApplication/SpecializedImageApplication
) . I am not altogether too familiar with IIS virtual paths, which may have
invited these problems in the first place.

I work in an development shop of one, and I maintain a MSFT server
infrastructure all by my onesome, so it is difficult to draw on peer
expertise. Be my peers. :)

Many thanks for any help you can offer.

-KF
 
M

Michael Nemtsev

Hello (e-mail address removed),

Why not to provide the web.config for the each project folder and put all
common stuff to the global web.config which is locates next to the machine.config?

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
G

Guest

Thank you Michael. My stupid response: I didn't realize this was possible.
It sounds like an excellent solution.

But what defines the "globalness" of the global web.config? In other words,
what contents in that global web.config file raise the "It is an error to
use a
section registered as allowDefinition = 'MachineToApplication'" error? What
declarative markup should I +not+ put in subordinate, non-global,
per-project web.config files?

If there is good documentation on the right way to structure multi-project
solutions, it would be great if someone could point me to them, many
thanks. I've been working in various ways with ASP.NET for more than two
years, and the "right" arrangement of projects in a solution has only
recently become clearer to me. For people who did not come into VS.NET
through a traditional developer background, the metaphors aren't intuitive.
Some folks are apt to analogize to the file management typical of a tool
like Dreamweaver. As they try to organize bigger sites and collections of
applications in the context of common code (e.g. my ORM classes) they will
unwittingly make some suboptimum choices, as I have.

-KF


Michael Nemtsev said:
Hello (e-mail address removed),

Why not to provide the web.config for the each project folder and put all
common stuff to the global web.config which is locates next to the
machine.config?

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
I'm seeking (probably basic) guidance on the right way to split a
large site that's supposed to represent one domain(mydomain.org) into
many small VS.NET projects, and how to avoid issues with multiple
web.config files leading to the error: "It is an error to use a
section registered as allowDefinition = 'MachineToApplication'"...
 
M

Michael Nemtsev

Hello (e-mail address removed),
But what defines the "globalness" of the global web.config? In other
words, what contents in that global web.config file raise the "It is an error
to use a section registered as allowDefinition = 'MachineToApplication'"
error? What declarative markup should I +not+ put in subordinate, non-global,
per-project web.config files?

have u tried to search this error ?
see ther http://search.live.com/results.aspx...o+use+a+section+registered+as+allowDefinition
If there is good documentation on the right way to structure
multi-project solutions, it would be great if someone could point me
to them, many thanks.

See there http://msdn2.microsoft.com/en-us/library/aa302436.aspx
and there http://support.microsoft.com/kb/815174

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

Hello (e-mail address removed),

Why not to provide the web.config for the each project folder and put
all common stuff to the global web.config which is locates next to
the machine.config?

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog:
http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo
I'm seeking (probably basic) guidance on the right way to split a
large site that's supposed to represent one domain(mydomain.org)
into many small VS.NET projects, and how to avoid issues with
multiple web.config files leading to the error: "It is an error to
use a section registered as allowDefinition =
'MachineToApplication'"...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top