Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 30th, 2006, 08:29 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Help with Health Monitoring System

Hi all,

I need some help dealing with the health monitoring system at the end of Ch.3, particularly the code on p.109-110.

As per the note at the bottom of p.109, I've added a new project to my solution to contain the WebCustomEvent class, which builds without errors, then added the class as a reference, which adds the bin directory to my main project containing the CustomEvents dll, but when I go to run web pages within the project, I get the following error:

 
Quote:
quote:Error 65 Could not load file or assembly 'DOAH.BugTracker.WebCustomEvent' or one of its dependencies. The system cannot find the file specified. C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\BugTracker\Web.config 62


The code that I have is identical to that of the book, with the exception that I've traded out Marco's namesaces for those of my own, as follows.

Class Library Named: CustomEvents
Class File Named: WebCustomEvent.cs
Quote:
quote:using System;
using System.Web;
using System.Web.Management;
using System.Collections.Generic;
using System.Text;

namespace DOAH.BugTracker
{
  public abstract class WebCustomEvent : WebBaseEvent
  {
    public WebCustomEvent(string message, object eventSource, int eventCode)
      : base(message, eventSource, eventCode) { }
  }

  public class RecordDeletedEvent : WebCustomEvent
  {
    private const int eventCode = WebEventCodes.WebExtendedBase + 10;
    private const string message = "The {0} with ID = {1} was deleted by user {2}.";

    public RecordDeletedEvent(string entity, int ID, object eventSource)
      : base(string.Format(message, entity, ID, HttpContext.Current.User.Identity.Name), eventSource, eventCode)
    { }
  }
}
healthMonitoring code is located in the system.web section of my web.config file, as follows.

 
Quote:
quote:<healthMonitoring heartbeatInterval="10800">
Quote:
      <providers>
        <remove name="SqlWebEventProvider" />
        <add name="SqlWebEventProvider" connectionString="BugTracker" buffer="false" bufferMode="Notification"
          maxEventDetailsLength="1073741823" type="System.Web.Management.SqlWebEventProvider, System.Web,
          Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03 f5f7f11d50a3a" />
      </providers>

      <eventMappings>
        <add name="BT Events" type="DOAH.BugTracker.CustomEvents, DOAH.BugTracker.WebCustomEvent" />
      </eventMappings>

      <rules>
        <clear />
        <add name="BT Events" eventName="BT Events" provider="SqlWebEventProvider" profile="Critical" />
        <add name="All Errors" eventName="All Errors" provider="SqlWebEventProvider" profile="Critical" />
        <add name="Failure Audits" eventName="Failure Audits" provider="SqlWebEventProvider" profile="Critical" />
        <add name="Heartbeats" eventName="Heartbeats" provider="SqlWebEventProvider" profile="Critical" />
      </rules>
    </healthMonitoring>


The error seems to occur in the eventmappings section.

Any help would be very much appreciated.

Thank you.
  #2 (permalink)  
Old August 30th, 2006, 09:52 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you have compiled your DLL for TBH_Events and you have used a namespace the issue may be there. Use ILDASM found in "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\ildasm.exe" and check the assembly. After my first compile I discovered the namespace to begin MB.MB.TheBeerHouse... It was resolved by removing the default namespace from the project.



  #3 (permalink)  
Old August 30th, 2006, 11:36 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've done like you suggested and can't seem to find anything that looks like what you're talking about. I've double checked all my pages to make sure that my namespaces are correct, and they are to my knowledge. The dll loads into my project, but when I build it, I get the error. :/

  #4 (permalink)  
Old August 31st, 2006, 11:52 AM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I've gone into the properies of the class library project->Application and tried to remove the default namespace, but it won't let me. I delete the info, but as soon as I try to remove focus from the defaulkt namespace field, it alerts me the the value is invlaild an refreshes the field to the removed value.

I've triple checked all my pages and everything seems to be exactly like the TBH site, again, with the exception that I've opted for my own namespace of DOAH.BugTracker vice MB.TheBeerhouse.

I've got the class library referenced, and still not luck. Please help.



  #5 (permalink)  
Old August 31st, 2006, 12:00 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I think I've made some progress. I've completely unloaded everything and step by step reloaded and referenced the CustomEvent class library to the project.

Now I get a new error message: Error 65 Format of the initialization string does not conform to specification starting at index 0. /
  #6 (permalink)  
Old August 31st, 2006, 12:48 PM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the problem. I had something in the SqlWebEventProvider transcribed incorrectly.

  #7 (permalink)  
Old October 12th, 2006, 02:54 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hecsan07 Send a message via Yahoo to hecsan07
Default

What do you mean by "transcribed incorrectly"? What exactly was wrong with it? It may be the same thing I am doing wrong. Can you please help me? I am been dealing with this behavior for hours. It's been kicking my ass really bad.

Hector
  #8 (permalink)  
Old October 15th, 2006, 04:15 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm fairly new at this. But hopefully I can be of any help :-)

I had the same problem. And the solutions suggested didn't help.

Here is what I did:
  • 1. Double-click on "Properties" folder in CustomEvents project
  • 2. Make sure the assembly name is: MB.TheBeerHouse.CustomEvents
       (or in your case: DOAH.BugTracker.CustomEvents)
  • 3. Make sure default namespace is: MB.TheBeerHouse
       (or in your case: DOAH.BugTracker)

Save the Properties and compile.

That seemed to work for me. I got passed the same error and everything compiles as of now... (knock knock on wood ***)


  #9 (permalink)  
Old October 19th, 2006, 08:11 AM
Authorized User
 
Join Date: Aug 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I apologize for not answering sooner, I've been away on business.

As for the problem, it took me a while to get the configuration to work like sats mentioned above, but I did get that to work. I'm not sure how much lag there is in updating certain changes(like these), but there seemed to be some, though I can't pinpoint from where.

Once I had the properties set and was convinced it should work, it still didn't work for me, so then moved to previous step where I had copied the event handler into the config file. Once I had that rewritten, it worked.

I can't confirm that I actually made any change at all to the event handler code, I went through it several times and couldn't find any errors, but once I copied the handler from the sample code, it worked.

Basically, the way I see it, I lucked out and all the pieces fell into their proper places, because I still have no idea exactly what was wrong in my code :/.



 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05: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 10:52 AM
Configuring the Health Monitoring System hoouliganian BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 30th, 2007 08:00 PM
Health Monitoring System spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 October 31st, 2006 09:28 PM
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



All times are GMT -4. The time now is 03:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.