Date Published: 12 February 2005
Updated the AspAlliance.com a few minutes ago. The new site looks like this:
First off, it won’t look anything like this if your CSS file is cached. So if it looks goofy to you, hit CTRL-F5 to refresh all files including the new CSS.
I ran into one problem that threw me for a loop when I deployed. I started getting Site is Invalid errors, which I tracked down to my XslTransform class’s Load method. Apparently since the web cluster that hosts AspAlliance.com uses a network file system (several web servers all share one file server which has the site’s files), there were some security issues. I Googled and found these references:
This oneI found first – no resolution. Then this one, which gave the key piece of info (thanks Bret @ MS):
If you trust the remote XSLT, you give XsltTransform the same level of trust
as the calling assembly by passing this.GetType().Assembly.Evidence to the
evidence parameter of the Load method.
Unfortunately, there isn’t an overload of the XsltTransform’s Load method that accepts just a string file path and some Evidence. So I searched a bit more and found this postwhich gave me the XmlTextReader overload syntax, and that did the trick.
My final code:
XmlDocument docXml = new XmlDocument();\ docXml.Load(Server.MapPath(siteMapFileLocation));\ XslTransform docXsl = new XslTransform();\ XmlTextReader reader = new XmlTextReader(Server.MapPath(transformFileLocation));\ docXsl.Load(reader, null, this.GetType().Assembly.Evidence);\ System.IO.Stream myStream = new System.IO.MemoryStream();\ docXsl.Transform(docXml, null, myStream);
Now, I’m getting tons of emails from ELMAH because I turned on admin emails. I’ve since turned it off. Has anybody modified this part of ELMAH to have it batch error messages (instead of 1/email)? Or to make it ignore 404 errors (at least for emails)? I would like to be notified of *real* problems with the site, but I don’t need to see every 404… Oh well, if nobody tells me they’ve already done this, which is what I expect, then I’ll do the mods myself perhaps next week.
Tags - Browse all tags
Category - Browse all categories
Steve is an experienced software architect and trainer, focusing on code quality and Domain-Driven Design with .NET.