Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 05, 2012 12:10 AM by hans_v
Feb 06, 2012 02:32 PM|LINK
I'm trying to force a machine key to regenerate, since it's configured as follow:
but I don't know which event can start a new (automatic) generation
of a new machine key...
Feb 08, 2012 07:57 AM|LINK
In c# to generate a machine key
Macro to Generate Machine Keys
Feb 08, 2012 12:53 PM|LINK
I'm sorry but I have a different purpose:
I have a machine key "Autogenerate,IsolateApps", and I want some tool/code to create a new Autogenerated machine key in a transparent way, without knowing what the key is, and more important WITHOUT the need to insert it in my web.config...
I think that the Autogeneration can launch the creation af a new key under some conditions, I would like to know what are those conditions...
Thanks in advance
Feb 08, 2012 09:49 PM|LINK
I would like to know what are those conditions...
A new key is generated when the application pool recycles. You can force an application pool restart by calling
Aug 03, 2012 08:06 PM|LINK
hans_v, how did you know that?! I've been looking all over for when the machine key gets auto generated and couldn't find that answer. Maybe I was asking the wrong question? Anyways, I'd love to know your source. Please share!
Aug 05, 2012 12:10 AM|LINK
hans_v, how did you know that?! I've been looking all over for when the machine key gets auto generated and couldn't find that answer.
According to MSDN, when using the default settings, this shouldn't happen. But after many problems (unexpected logouts on irregular intervals, validation of viewstate mac failed errors) on different shared hosted environments, I starred to log all the applicatiomn
starts, and I noticed that when the problems occured, the application was also restarted. The common source I noticed was the machinekey, which is used to encrypt both the ViewState and the Authentication. Since then, I always use a Machine Key, and never
ever had any problems like this anymore....