Welcome to MSDN Blogs Sign in | Join | Help
CreateMachineKey Utility Program

A couple of years ago I was showing a customer how to configure ASP.NET for use in a web farm. Part of the procedure requires you to adjust the <machinekey> element in each server to the same settings, so that the ASP.NET encryption logic is using the same keys throughout the farm.

MSDN article KB312906 showed a simple command-line utility for generating the keys, but I wanted something more like the CreateGuid utility included with Visual Studio. Therefore, I wrote a WinForm version of the KB utility that I call CreateMachineKey and gave it to my customer and a few other folks who heard about it.

Recently I revisited CreateMachineKey in order to update it for ASP.NET 2.0, which has some significant changes that are described in a Patterns & Practices document. Since I had the code open on the operating table, I decided to zip it up and make it available via this blogsite. It's attached to this article, and I hope you find it useful.

For those of you who are really picky: Yes, I know CreateMachineKey doesn't support MD5, but that wasn't necessary for my purposes. However, if you decide to add that feature, please post it in a comment. Likewise if you find any bugs, although I doubt that's even possible. :-)

Dave Schmitt
July 20, 2006

 

Posted: Thursday, July 20, 2006 2:47 PM by craeblog

Attachment(s): CreateMachineKey.zip

Comments

No Comments

Anonymous comments are disabled
Page view tracker