Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2007, 06:02 PM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 - Configuration Error

Hi All,

I've reached Chapter 3 page 87, and all of a sudden any page I try to run (even from previous chapters) are giving me errors. I'm not sure what I could have mistakenly done, but I can't figure my way past this. Can someone advise?
Thanks

 Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: 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.

Source Error:

Line 39: Set forms authentication and define the login page
Line 40: -->
Line 41: <authentication mode="Windows">
Line 42: <forms loginUrl="Default.aspx" />
Line 43: </authentication>


Source File: C:\Inetpub\wwwroot\tests_and_examples\ASPX\WROX\z_ end\chapter03\wroxunited\web.config Line: 41


Show Additional Configuration Errors:

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:\Inetpub\wwwroot\tests_and_examples\ASPX\WROX\z _end\chapter03\wroxunited\web.config line 48)

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:\Inetpub\wwwroot\tests_and_examples\ASPX\WROX\z _end\chapter03\wroxunited\web.config line 49)

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:\Inetpub\wwwroot\tests_and_examples\ASPX\WROX\z _end\chapter03\wroxunited\web.config line 64)

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:\Inetpub\wwwroot\tests_and_examples\ASPX\WROX\z _end\chapter03\wroxunited\web.config line 83)



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
 
Old January 19th, 2007, 11:03 AM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I may have it figured out, but can use some help understanding.
I have been creating folders for each chapter as I go along, and have a folder of the completed Wrox example site as well. All of these folders reside in one maindirectory that I'm using to practice in.

I get the impressions that once I pulled the "end" files from the Chapter 3 Download Zip, that I created multiple instances of the Web.config file. The Sub Directory that I had the full example site in, and the Chapter 3 End directory I created both have that file.

So it seems, that I can't have a folder for each chapter, all in my working practice directory, because even though the config file isn't on the same level (or sub folder), they are colliding with each other.

Is that the general gist of it?
2 web config files within the same working directory, regardless of what sub folder level they may independantly be in, will cause the error?

I assumed that the file I run would use the config file in the same directory (and not seek another one elsewhere)

Thanks

Thanks
-Dave
 
Old January 19th, 2007, 11:13 AM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Further Testing.

Created a new site with Just Chapter 3 Begin content.
Got the error.

There was a Smaple and a Wrox United Folder.
Deleted the Wrox folder so there is only one config file in the samples folder.

Still getting the error with just the samples folder.

This is becomimg very frustrating and tedious to get past this early portion of the book.
Any help / advice would be greatly appreciated
 
Old January 31st, 2007, 03:30 PM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Very Very disappointing.
2 weeks and no response.
I'd love to learn from this book, but it's starting to not seem possible.
 
Old February 12th, 2007, 09:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

Hi David,

Apologies for not replying sooner. I've been moving house. You're definitely on the way to solving your problem. From what you've written, the issue probably is because you've been copying the Chapter03 folder across directories. Can I just check which web server you're using - IIS or the server in VWD? When you load the site in VWD do you just hit F5 to run the site or use IIS to run the site?

Basically, The <authentication> element is only allowed in your web.config at the root of your application. If you copy the whole site (and web.config), the web server gets confused and the allowDefinition="machineToApplication" setting - which is in the machine.config file in your .NEt installation directory cries foul because it doesn't know which web.config <authentication> element is correct for the web application.

The basic solution if you run IIS is to create a virtual application for each copy fo the website you create - this will isolate each web.config within a virtual application as required.

If you're using the web server (Cassini) inside VWD, hitting F5 while the site is loaded in VWD should be enough to create a virtual application around it and for you to have no problems. A general rule fo thumb would also be to just use one copy of the website. If you have to keep multiple copies, stick the ones you aren't using in a Temp folder somewhere away from the current one and that should clear it up.

If you google for allowdefinition='machinetoapplication' as well, there are many many threads on other forums which can help you out as well but the above is the usual solution.

I hoep that helps and sorry for the delay

Dan



Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
 
Old March 7th, 2007, 11:18 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same error. Looking back in the book, the solution was there all the time: just below Figure 3-31 the text says: close down the Chapter03 project. Then, the Try It Out starts with: Open the Wrox United application in Chapter03. So, go to VWD, File, Open Website and browse to the WroxUnited folder inside the Chapter03 folder (do NOT select the Chapter03 folder itself). With WroxUnited as the root folder of your webapp, you should be fine. It makes the web.config in the Chapter03 folder invisible to the webapp.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuration Error: While navigating rav BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 September 19th, 2007 04:07 PM
Chapter 03- Chat Server Configuration Error danielson BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 March 27th, 2007 11:50 AM
Configuration error exstream ASP.NET 2.0 Professional 2 July 2nd, 2006 02:52 AM
Configuration error exstream ASP.NET 2.0 Basics 1 May 6th, 2006 12:39 PM
Configuration Error johno BOOK: ASP.NET Website Programming Problem-Design-Solution 6 July 22nd, 2005 10:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.