To get logging working without pesky WMI/Performance counter errors on
every logged event:
Per Tom Hollander’s weblog
Go to the Logging project, Project Properties dialog for the Common
project, and under Configuration Properties\Build, find the Conditional
Compilation Properties property and remove ;USEWMI;USEPERFORMANCECOUNTER
for the build type you’re interested in (ReleaseFinal, in this case).
Ignore compile warnings about DB2 goop.
Delete any old project references and re-add reference to new version in
C:\Program Files\Microsoft Enterprise Library\src\Logging\bin\ReleaseFinal.
Then add an appropriate using statement and use in code:
/// Summary description
DefaultPage : System.Web.UI.Page
Page\_Load(object sender, System.EventArgs e)
// Put user code to initialize the page
LogEntry logEntry = new LogEntry();
logEntry.Message = “Starting up the application”;
// Now this is cool! Tracing flow of code
// and it was simple to add an EmailAlert
with an EmailSink
Logger.Write(“Hello by e-mail”,
“An e-mail message logging all kinds of stuff”);
\#region Web Form Designer generated
override protected void
// CODEGEN: This call is required by the
ASP.NET Web Form Designer.
/// Required method
for Designer support - do not modify
/// the contents of
this method with the code editor.
this.Load += new System.EventHandler(this.Page\_Load);
It’d sure make it easier to post code to my weblog if VisualStudio 2005
functionality. This is a great application, too bad it doesn’t work for
me. I seem to have uncovered the first interaction between CSAH and a
trial VisualPerl installation that won’t uninstall.
Par for the course.
Although, I’ve suggested to the Visual Studio 2005 guys that they add
P.S. Collin worked to fix CSAH, and I nuked and reinstalled my system,
including Visual Studio 2003.NET. That seems to have done the trick.