.NET musings, news, and product reviews courtesy of the Averetek development team.
I was trying to set up error handling for a web app using the Windows event log and ran into trouble creating a new source. This code:
string SourceName = "New Test Source";
if (!System.Diagnostics.EventLog.SourceExists(SourceName))
System.Diagnostics.EventLog.CreateEventSource(SourceName, Application");
which has successfully run in the past, now throws a security error. Apparently ASPNET doesn't have permission to read the Security event log. Probably picked up in some recent security update.
I tried adding relevent permissions, but still ran into trouble. Reluctantly, I followed the advice under "First Approach" at
http://support.microsoft.com/kb/329291 and proceeded to manually add my new source directly to the registry. Worked like a champ, and now I'm back on the road again.
To avoid a little message in each entry protesting lack of info about event IDs, add a string for EventMessageFile. I used C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll.
Labels: .net, event log, windows
An end user wrote to customer support for help because she couldn't get access to a site with the authorization code that had been generated for her.
The code she received was 0WUGOS. The first character is a zero, the fifth is the letter O. Depending on the font being used, they can be hard to tell apart. How much do you want to bet she was typing the letter O for both?
When writing a routine to generate a code that somebody will have to type in, it's a good idea to throw out any characters that could be easily mistaken for another. The letters I and O and the numerals 1 and 0 are the most likely suspects. If you really want to avoid any possible confusion, throw out U and V too.
As I extend my knowledge of SQL development I am constantly finding new tools that are undocumented. Here are some nice ways to know what state your database is in and some other tools to help maintain it.
http://www.4guysfromrolla.com/webtech/032906-1.shtmlhttp://www.mssqlcity.com/Articles/Undoc/SQL2000UndocSP.htm

Microsoft is working on an AJAX toolkit called Atlas. Here's a good
overview in the form of a screencast from Jon Udell. He interviewed Microsoft's Shanku Niyogi, who demonstrated some of the capabilities. AJAX extensions for ASP.NET, pretty cool!

This is a cool opportunity to use technology to solve one of history's mysteries. The M4 project is using distributed computing to decipher the 3 original
Enigma messages. The
first message has already been broken. Binaries are available in multiple flavors for Windows and Unix.
M4 project home page
Ever wonder what's the best way to represent a symbol or special character in HTML? For example, if you want to display the registered trademark symbol (®), there are at least three ways to do so:
1) Enter the raw character - ®
2) Encode it using a
numbered character entity - ®
3) Encode it using a
named character entity - ®
There are advantages and disadvantages to each approach. After a little searching, I found an excellent article on the subject at
http://www.blooberry.com/indexdot/html/tagpages/text.htm. In this case, they recommend going with the numbered character entity. Check out the article to find out why.
Most of my time is spent using Outlook, MSN Messenger, Visual Studio, and SQL Management Studio. Here’s my tidy list of other applications I use on a daily basis.
SlickRun – spend five minutes with this great application and then spend the rest of your life wishing you had thought of it. SlickRun is a free floating command line utility for Windows. I use it about 100 times per day and almost never use the XP Start menu anymore.
JetStat.com IIS Admin – while there are many utilities to let you run & manage multiple IIS sites in Windows XP, very few of them are as lightweight as this one. It runs in the tray, and when minimized consumes less than 2 MB.
.NET Reflector – Loetz’s Reflector is a class browser for .NET components. It disassembles and displays in VB, C#, IL, and Delphi. It also has an analyzer that enumerates class dependencies, allowing you to quickly see the impact code changes will have on the rest of your application.
UltraEdit – I use less than half of the features available and it still smokes any other editor out there.
OnTime – Dark Frequency standardized on AxoSoft’s OnTime for defect tracking. Feature-rich, highly customizable, and reasonably priced – the single-user version is even free.
Picasa – I have a million photos and this helps me organize them with Google's customary efficiency.
Cropper – Brian Scott’s simple screen capturing app that lets you selectively capture parts of your desktop. Outputs to GIF, JPG, PNG, and others.
iTunes – WinAmp may whip the llama’s ass, but iTunes it’s still the best platform for playing and managing my music. It’s an OK MP3 player but anyone can do that. The Smart playlists, hooks into the music store, and (of course) the iPod integration make it all work.
I also love my
BlackBerry but who knows how
long that will last…