Curtis Swartzentruber

in

February 2006 - Posts

You can't run ASP 1.1 applications under an ASP 2.0 root
Originally posted this over on my personal blog, but it seems relevant to what people might run into when doing ASP.NET migrations, especially in more complex scenerios.

Well, apparently you can't run a 1.1 ASP.NET application under a ASP.NET 2.0 root. IIS Manager allows you to set the target framework at the application level, but the 1.1 application will still bubble up through the 2.0 web.config and fail to validate. What I haven't determined is whether it works as long as your 2.0 web.config doesn't have any 2.0 specific entries. This seems unlikely since for a lot of the new features you need new config entries and I think some of the structure changed as well, so my gut is it just won't work. So until I can get Community Server running under ASP.NET 2.0, I can't use my standard blog set up. The guys at WebHost4Life recommend setting it up as a subdomain and setting the version on the subdomain. This works because IIS treats the folder as a root node and so it sticks with ASP.NET 1.1 and works fine. The only problem is in the meantime I lose all my inbound links, feed subscriptions, etc which sucks. So much for the little bit of Google juice I had. I'll probably be able to go back to the old links at some point, but for now you'll have to hit my personal blog using:

http://blog.swartzentruber.net/CurtBlog

Please update your RSS aggregators and links accordingly. Here is the new direct URL to the RSS feed

CurtBlog RSS

Oh and I can't do a redirect with an Http 301 Response because if I could get that working, I wouldn't have this issue in the first place. People are going to have similar issues with nGallery, which I also use, as well as apps like DotNetNuke.
Posted: Feb 13 2006, 02:08 PM by cswartz | with no comments
Filed under: ,
6 months of Clarity blogs
Well, was checking some older posts and realized we've had the Clarity Blogs up and running now for about 6 months.  I've been busy making some improvements around the look and feel of the site and finally was able to get them deployed tonight.  It's been really good to see the quantity and most of all the quality of posts from the folks here at Clarity.  Most of us in the company know that we have the privilege of working with a lot of smart folks with a wide breadth of knowledge, but it's nice to be able to start sharing some of that with the community at large.
SHA1 Password Hashes in .NET 2.0

Starting to do some migration work and ran into a change in the framework that hasn't been well documented, luckily there is a good ASP.NET Forums post on the subject. A lot of sites that store user authentication info in the database will store a hashed password, often with SHA1 encryption that is then converted to an ASCII string. Then when the user attempts to log in, you just hash the password they provide and compare it to the database. The 2.0 Framework changes the way ASCII codes above 127 (which technically are invalid) are handled. The 1.1 Framework throws away the most significant bit, the 2.0 Framework returns, appropriately enough, the ASCII character code for question mark. To get the same behavior under 2.0, you have to do a bit of bitmasking, see the article for some sample code.

If you're like me and haven't done any bitwise operating lately, the VB.NET equivalent to the code in the post is something like, given a Byte array called PasswordHash

Dim PasswordHashConverted(PasswordHash.Length - 1) as Byte
Dim x as Integer
For x = 0 to PasswordHash.Length -1
  PasswordHashConverted(x) = Convert.ToByte(Convert.ToInt16(PasswordHash(x) And 127))
Next
Posted: Feb 07 2006, 08:49 AM by cswartz | with no comments
Filed under: ,