Hi Rob,
I think I introduced this bug recently while cleaning up FxCop violations. I was previously catching Exception but FxCop says to catch only specific exceptions so I changed it to catch InvalidOperationException which is what is thrown when using MS SQL on a new install. However MySql throws a MySqlException which inherits from System.Data.Common.DBException so I need to add another catch for that like this:
protected void UrlRewriter_BeginRequest(object sender, EventArgs e)
{
if (sender == null) return;
HttpApplication app = (HttpApplication)sender;
if (
(app.Request.Path.EndsWith(".gif", StringComparison.InvariantCultureIgnoreCase))
|| (app.Request.Path.EndsWith(".js", StringComparison.InvariantCultureIgnoreCase))
|| (app.Request.Path.EndsWith(".png", StringComparison.InvariantCultureIgnoreCase))
|| (app.Request.Path.EndsWith(".jpg", StringComparison.InvariantCultureIgnoreCase))
|| (app.Request.Path.EndsWith(".css", StringComparison.InvariantCultureIgnoreCase))
|| (app.Request.Path.EndsWith(".axd", StringComparison.InvariantCultureIgnoreCase))
)
{
return;
}
if (WebConfigSettings.UseUrlReWriting)
{
try
{
RewriteUrl(app);
}
catch (InvalidOperationException ex)
{
log.Error(ex);
}
catch (System.Data.Common.DbException ex)
{
log.Error(ex);
}
}
}
I'll have this fixed in trunk by tonight.
Thanks for letting me know.
Joe