Tuesday, November 21, 2006

It's not an error message that you see often when working with ASP.NET, but if you’re deploying to a new, clean machine, it can happen quite easily.

Failed to access IIS metabase screenshot

The problem comes around due to the order that components were installed on the machine, namely that The .NET Framework was installed before IIS. As a result, ASP.NET is not correctly configured to run. The easiest way to rectify this is to re-install ASP.NET with IIS.

aspnet_regiis –i

If you only require default settings then this is the easiest option. The Microsoft KB specified in the error message suggests the –ga switch, but that requires a little more knowledge of the Windows system as it requires you to specify the Windows User Account to run under (which is different between Windows 2000, XP, 2003, etc). Easier to simply use the –i switch!

posted on 11/21/2006 5:46:12 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Monday, November 20, 2006

I’ve been using NMock 1.0 as part of my normal TDD (Test Driven Development) routine for a while now. I’d heard that there was a new version available a couple of months ago, but I saw no benefit in making the switch. For a start, the syntax was radically different and I was reluctant to invest time in seeing how to use it.

 

Well, I finally got around to using NMock 2.0 and after much searching, found a link to the site: http://nmock.sourceforge.net.

 

That link was surprisingly difficult to track down I can tell you … numerous dead-links and empty websites all over the place! I had to cheat in the end and ask a friend for it (thanks Neil)!

 

The new syntax has grown on me after an initial distaste for it. It may look more complicated and cumbersome than previously, but it is actually more usable once you get into it. The only issue I have with it is that the failure messages are very verbose, which can make it a little difficult to see what is going on, but I guess you get used to that too.

posted on 11/20/2006 5:54:22 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Friday, November 17, 2006

When you're developing and testing your system, you'll want to test that any emails sent are actually being sent to the SMTP server correctly: the html format is all ok; email from and email to are correct; etc.

 

An easy way to do this is by configuring .NET to drop the emails you send to a specific folder. As long as you’re sending your emails via SmtpClient and are configuring it via the web.config file (if not, why not?), the following configuration section will set up the email folder:

<system.net>
   <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory">
         <specifiedPickupDirectory pickupDirectoryLocation="C:\Temp\EmailPickupFolder"/>
      </smtp>
   </mailSettings>
</system.net>

If you then browse to the folder, you’ll see files like below. When opened in notepad, you’ll see the email in it’s raw format, or if you need to check any Html formatting, you can open it in Outlook Express.

 

Notepad View

Outlook Express View

posted on 11/17/2006 12:04:22 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Friday, September 22, 2006

I discovered today Microsoft's version of online mapping, Live Local, which competes directly with Google Maps and here in NZ SMaps (aka Zoomin). They all use the same AJAX whizzy UI components, but there are a few things which set it apart from the rest of the crowd.

Here in NZ, we often end up at the bottom of the list for updating country specific features. Take Google Maps for example, which does not have the geocoding facilities to find anything but the main centres. This is where SMaps (Zoomin) have done a great job in taking the same mapping style, but adding the street level geocoding we need.

What I like about Local Live is that it now not only has the geocoding for NZ, but the driving directions too, which are not possible in any of the other products. It works great too and from what I've seen so far, it's pretty accurate. Of course it works slightly better in IE than in other browsers, but really (be honest!) is that really a problem for anyone? I also like how on the first page load, it knows roughly where you are in the world, so it can centre the map. Give it your IP address or use a plugin, it can locate your computer too.
posted on 9/22/2006 6:42:37 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Wednesday, September 20, 2006

I saw a video of Photosynth, from Microsoft Research, a while ago but couldn't for the life of me remember the product name! So when I was talking to some people about how Photosynth will crawl the web and find photo's similar to yours so that it can create a 3D space out of them, I was lacking in credibility as I couldn't back myself up!

Anyway, you can watch a demonstration here ... the mind boggles!
posted on 9/20/2006 7:14:18 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Wednesday, August 30, 2006

Just got chance to look at a link I was sent a week or so ago … Microsoft UK commissioned Ricky Gervais and Stephen Merchant of “The Office” to do a spoof training video. The film is viewable on the page via Google Videos … very funny!! Hopefully the link sticks around for a long while!

posted on 8/30/2006 10:05:14 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]

SpiralFrog, a free music download service, is due to be launched this December. The interesting part is that they believe they can support their venture by advertising alone, and by the fact that they have signed up with Universal Music Group, must mean that the numbers sound good!

The deal is that music and video downloads are free to use for 6 months from the download. The catch is that before the download starts, the user has to watch 90 seconds of advertising.

90 seconds is a long time to be forced to wait for a download to start for each song/video … how many people will just set it going and walk away? Mind you, it’s a novel concept that I’m pretty sure will see them become a popular site … everyone loves “free”!

posted on 8/30/2006 9:11:43 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Tuesday, August 29, 2006

The answer is that in ASP.NET, static variables should be used instead of the Application object. It's something that I had never considered in terms of best practice, until I was asked this week. After a little digging on MSDN I came across the guidelines which state:

  • Use static properties instead of the Application object to store application state.
  • Use application state to share static, read-only data.
  • Do not store STA COM objects in application state.

It comes down to the fact that the Application object is included for compatibility with classic ASP which had no application runtime like .NET.

You learn something new every day! More info can be found in the Knowledge Base article 312607.

posted on 8/29/2006 9:35:04 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]
 Monday, August 21, 2006

I came across a great web site today, www.mapmyrun.com. Using Google Maps, you can plot your run on the map and then get distance and speed calculations based on the route. The geocoding support from Google isn’t there for NZ, so you can’t search by address, but there is nothing stopping you from searching for the city and moving around manually. The bit I love best, is that you can view by satellite and also via Google Earth …

If you want to see the runs that I do most often, go here :-)

posted on 8/21/2006 9:20:59 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]