Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 December 6th, 2006, 06:39 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Configuring the Health Monitoring System

I had a few problems with getting the Health Monitoring System at the end of Chapter 2 (pgs. 109-110) to work, and the book is not very clear about that section. When I searched the forum, it seems several other people had problems with it too, but I didn't really find a comprehensive solution.

So I thought I'd just share what I did to get it to work, in hopes it will make things easier for someone else.

(And if there are any errors, then by all means, feel free to point them out.)



First, create a new project (File > New Project);
Project type: Visual C#;
Template: Class Library;
Name: TBHCustomEvents (or whatever your replacement name is);
Location: place it within the main project's folder;
Solution: ADD TO SOLUTION

Rename the class that was automatically created in TBHCustomEvents to "CustomEvents.cs" (or whatever you want to call it).

I then copied the code for CustomEvents.cs from the solution code and pasted it into mine. Remember to change the namespace from MB.TheBeerHouse if you're using something else.
Note that, as you'll see below, you may want to try adding the references (my next step) BEFORE you copy-paste this code. If you copy-paste it now (as I did), the code does not recognize most of the namespaces called at top of the file (ie "using System.Web.UI;" etc.).

I then added the references (right-click "References" folder under TBHCustomEvents > "Add Reference"). From the .NET list, add: System, System.Data, System.Web, System.XML.

I later found that even with these references added, they were still not being recognized at the top of the CustomEvents.cs file. As someone else pointed out, there seems to be some delay in some items being recognized. Cutting those first 10 lines from the file then pasting them back in, however, fixed it.

Click on the TBHCustomEvents project file. In the properties window, click on the "Property Pages" button.
Adjust the Assembly Namespace to "MB.TheBeerHouse.CustomEvents" (or whatever it would be for yours),
and Default Namespace to "MB.TheBeerHouse" (or whatever you're using).

Go up to the main (TheBeerHouse) project, right-click > Add Reference. Under "Projects" select the TBHCustomEvents project to make sure it's referenced.

Now you're almost done.

Copy the <healthMonitoring> section of the code (as per pg 110) from the source code into your web.config file.

Everything should now work.

I will also add this note: When I tried running the project along the way trying to fix some problems, it told me that I had problems with the web.config file. Specifically, it seemed to have a problem with the schema defined in the <configuration> tag.
You can ignore those messages. It turned out that the problem was not with the schema or even the web.config file at all. The underlying problems were all with getting the TBHCustomEvents sub-project setup correctly.



So, that's what I did, and it worked for me.
Hope that helps someone!
 
Old January 22nd, 2007, 01:03 AM
Authorized User
 
Join Date: Sep 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much! fyi to everyone else who is having issues with CustomEvents - I applied these steps to Chapter 5 solution and it worked. I wish someone would please explain why the original references went bad after changing the namespaces :)

 
Old January 30th, 2007, 09:00 PM
Authorized User
 
Join Date: Jan 2007
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's one thing I'd like to add though (however it might be obvious to many people). After all of those steps, you have to go to the Build menu and choose "Build CustomEvents" before everything works.

Thank you so much man. I initially laughed at how skimpy the explanation in the book was. Then, I was pulling my hair out when I realized I couldn't figure it out myself.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Developing a Health Monitoring UI Lee Dumond BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 22nd, 2008 06:26 AM
Health Monitoring System vic02 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 February 7th, 2007 11:52 AM
Health Monitoring System spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 October 31st, 2006 10:28 PM
Need Help with Health Monitoring System ryandoah BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 8 October 19th, 2006 08:11 AM
Health Monitoring System - Chapter 3 Page 109 - 11 Laurie S. Stapleton BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 31st, 2006 12:13 PM





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