Saturday, March 31, 2012

Web.config error on opening a web site from a local file system

To run an example from ADOnet 2.0 SBS 2005 edition, I opened a web site from
File System (Microsoft Press folder). I can review the Design and Source
tabs; however, running an example program, e.g. Chap 14-Finished, showed 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. C:\Microsoft Press\ADO.NET 2.0 Step by Step\Chap14\VB\Chapter 14 -
Finish\Chapter 14 - Finish\web.config 51

I have created a virtural dorectory pointing to C:\Microsoft Press\ADO.NET
2.0 Step by Step\ and IIS Admin did show a virtual directory. Why Chap 14
web site can not be opened?

TIA,
Jeffrey

Probably nested web.config files. Check the folders above it and remove/rename any others.

Jeff


Thanks.

As I indicated in my post, the web site I opened was from a file folder named ADOnet2SBS, which has many subfolders
for different chapters. As shown on the Solution Explorer of VS desktop, there is a web.config for each "web site" opened
from each chapter subfolder

Is this the "nested web.config" which caused the error? I have noticed that my Chapter 15 was okay, then Chapter 16
showed the error msg. How can I keep running Chap. 16? Or I have to delete the web.config from Chapter 15 subfolder?

TIA,
Jeffrey


Hi Jeffrey,

Based on my understanding, you create a virtual directory and place multiple asp.net applications within this virtual directory. When you run the application on the IIS, you get the error message above. If I have misunderstood you, please feel free to let me know.

The error message indicates that we have not to create virtual directory for this application correctly.

If we want to run multiple websites which exist in the same virtual directory, we can try to create a Bin folder in the root folder of every application and place the web.config file in the corresponding Bin folder.


I hope this helps.

0 comments:

Post a Comment