Monday, April 07, 2008

You must specify a non-autogenerated machine key to store passwords in the encrypted format. ASP.NET Error & Solution

When you develop and run an ASP.NET 2.0 application which uses user management controls like CreateUserWizard, Login, Forgot Password and etc, you would be greeted with an error message

You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.

This error message is displayed if you choose to store encrypted passwords with the  membership providers and there is no machine key available in web.config file.

How To fix this error

  • Use machine generator service  to generate a new machine key(ASP.NET 2.0 and 1.1 versions are supported)
  • Copy appropriate machine key (either ASP.NET 2.0 or 1.0 version) to clipboard
  • Paste the copied machine key in web.config file of your web site or web project inside the section <system.web>
  • That's all. Now you can run the web application with out this error.

1 Comment:

Anonymous said...

Thanks, this is exactly what I needed!