mercoledì 30 maggio 2007
Score another one for me!
(O): Build (web): Unable to find the required module. (Exception from HRESULT: 0x8007007E)
As you can see, it says nothing about WHICH module is missing. I tried for a few days to fiddle with dependant assemblies, web.config settings, etc. but only today I have been able to investigate and fix it. I downloaded ProcessMonitor from the Microsoft site and after defining the appropriate filters I tracked down the missing assembly: it was MSVCR71.DLL. Just found a copy on some other location on the HD, placed it into C:\Windows\System32 and it worked flawlessly.
I feel like I deserve a reward. Going to buy an icecream! :-)
domenica 13 maggio 2007
WTF?
While checking the error logs for SkakkiNostri, this morning, I noticed something strange. Yesterday night something like a spider crawled my site, querying the robots.txt as usual, but then it started messing with the file paths.
It tried to visit the pages listed in the web site root (e.g. /forum.aspx), but under the /admin/ folder (/admin/forum.aspx). These do not exist, so I received a notification of the 404 error.
The user agent for those request is Java/1.5.0_11, and the originating host is a dynamic IP of the Telecom Italia range. So maybe one of my user tried a lame scanning tool, but that IP was not in the http logs. How strange...
However I am starting to be annoyed by these notifications. Please, fix that scanning tool! :-)
sabato 12 maggio 2007
Now I have no excuses
/// <summary>
/// Processes the HTML message.
/// </summary>
/// <param name="message">The message.</param>
/// <returns></returns>
public static string ProcessHtmlMessage(string message)
{
[ ... ]
}
venerdì 11 maggio 2007
A little gem
A rant
Now, three of them have video ads. I just can't stand them. Just move the mouse above them, say to click on a link, and they start playing. One of them even starts without intervention. ARGH! It's a long time since I subconsciously installed a brain filter for moving images in web pages, but now they have audio! Imagine my beloved classical music overtaken by a loud voice saying "Take control of the compliance!".
Stop now, please. PLEASE! Video adverts make baby Jesus cry!
mercoledì 9 maggio 2007
SmtpExceptions
Right now, my inbox is full of SmtpException notifications. I need to do something to track them in an appropriate place, possibly filtering and grouping notifications. Any ideas are welcome.
Reminder to myself
How to escape apostrophes in XPath / .net
Yesterday I found something interesting: there isn't a correct way to escape string literals in XPath queries.
Example:
galleryDocument.SelectSingleNode("//photo[filename='" + photoFileName + "']");
This line raises an exception if photoFileName contains an apostrophe. Neither ' nor \' nor '' work as an escape sequence - the XPath specifications do not handle that. So, how do we deal with it?
The answer is a small routine that relies on the concat XPath function:
public static string EscapeApostropheForXPathParameter(string parameter)
{
if (!parameter.Contains("'")) return "'" + parameter + "'";
string[] parts = parameter.Split('\'');
string result = String.Empty;
foreach (string part in parts)
result += ", \"'\", '" + part + "'";
return "concat(" + result.Substring(7) + ")";
}
This routine basically maps the string "foo'bar" into concat('foo', "'", 'bar'). Please note the different kind of quotes around the apostrophe. Nice to know, huh? :-)