Friday, January 25, 2008

The file web.sitemap required by XmlSiteMapProvider does not exist

The file web.sitemap required by XmlSiteMapProvider does not exist

I used a custom XMLSiteMapProvider where in i have defined a web.sitemap file with urls.
The application worked fine in the test environment and for administrators but errored out for other users.

The actual error was that the normal anonymous user didn't have enough permission to access the web.sitemap file - in fact it needed permission for the whole directory.

It seems IIS still has some issues with directory/file permissions and the account used for anonymous access (e.g.: IUSR_MACHINENAME).

Monday, January 14, 2008

How to email using TELNET

TELNET mail.plano1.tx.home.com 25
HELO test (127.0.0.2)
MAIL FROM:billgates@richguy.com
RCPT TO:fulano@sicrano.com
DATA
bla-bla-bla

. (<- enter-dot-enter to finish)

QUIT

Sunday, January 13, 2008

Fixing Error when IIS doesn't start

A convenient way to deal with "Unexpected Error 0x8ffe2740"

Ever had the annoying problem of IIS not wanting to start, coughing up the message "Unexpected Error 0x8ffe2740 Occurred."? The reason is that some other application has grabbed port 80. The most common applications doing this are Skype or Trillion. You can try just ending task on them and see if IIS will then start. If you're not running either of those then what could it be? Microsoft's KB article about the subject describes using the third-party utilities TCPView or FPort. But I think an easier way to find the issue is to simply drop out to a command prompt and run:

netstat -aon

Scroll up to the top part with TCP listings and you'll see something like this:

Then under "Local Address" look for 0.0.0.0:80. This is your entry, and a the far right is the PID you're after. With that number you can then run Task Manager, select the Process tab, and add the PID column in the display from View / Select Columns:

When you've found the process with the same PID, end task on it. The universe should then return to a state of perfect harmony. (Or at least your IIS will be able to start at that point!)

Another more geeky option to kill the offending app is to compile and run this line of .NET code:

System.Diagnostics.Process.GetProcessById( PID# ).Kill()

(Of course putting in the proper PID where indicated there.)

With everything that the Process class does, you could actually write your own highly effective Task Manager application in .NET if you really wanted to!

Utilities to replace SpinRite

The UBCD (http://www.ultimatebootcd.com/) has several (free) utilities for scanning disks for physical failures.


For data recovery tools: Undelete Plus (http://www.undelete-plus.com/) and TestDisk (http://www.cgsecurity.org/wiki/TestDisk).