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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
when i am trying to add server controls in design view as per given in book and debugging the page it gives me the error
Error 70 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:\Documents and Settings\Chitra\BEGASNET2\chapters\Begin\Begin\Cha pter03\WroxUnited\web.config 41
You need to turn to Appendix B of the book and follow the procedure there
to add the app name in IIS in the Virtual Directory. I had the same problem but
was able to fix it.
You may also find that you have to add certain maintenance to SQL before the
tool to insert into the virtual directory is installed on your machine. (There
are previous forum articles about that, from one of the book's authors.)
This is a pretty convoluted mess that readers have to go thru to get up and running.
I am having this problem now too. I am using the Cassini server. I was not having any problems with anything until Chapter 3. Now, nothing works. Every page is throwing errors.
I had this same problem "allowDefinition='MachineToApplication' beyond application level" and after a lot of experimentation and research on the net I believe I have found the problem. I have since seen several posts to fix this problem. However, I thought I would write a quick and easy solution, with little confusion.
The problem has to do with having two Web.config pages. The book instructs you to start a new website at c:\BegASPNET2\Chapters\Start\Chapter03. If you do this you will have included a web.config at the root of your new Website (Chapter03) and have one inside the WroxUnited folder. Having 2 web.configs causes these weird errors. To fix this problem I simply started my new website inside the Wrox United Folder and presto no more irritating message.
Okay, now that everyone else has it working, I'll put in my 2 cents. In order to get the 'try it out' on page 74 working, I had to create a new folder (called it Chapter03-Wrox) and move everything but a new web.config file and the ServerControls.aspx file into it. There area web.config files in both the Wrox and Samples folders and boy does that mess things up.