Location to persist custom machineKey

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
10/31/2008 2:01:32 PM
Gravatar
Total Posts 20

Location to persist custom machineKey

In my web.config file I have set a custom machineKey value, rather than using the one included in the standard configuration.

Is there a location where I can persist this setting across upgrades (like user.config does with appSettings), rather than editing this value back into web.config each time I upgrade mojoPortal?

Lorien

10/31/2008 2:10:12 PM
Gravatar
Total Posts 18439

Re: Location to persist custom machineKey

Hi Lorien,

I wish it were possible but as far as I know its not possible to store it in a separate file, so it does have to be maintained. In fact it could be very bad to lose the key on an upgrade because if you use encrypted or hashed passwords and that key changes I'm pretty sure it will lock out all the users and be difficult to recover because I'm pretty sure that key is used as part of the encryption or hashing.

What I would recommend is to keep a copy of it in a comment section within user.config so you always have a place to copy it from. Thats what I do on my site also with the system.net mailsettings section of Web.config. Keep it in comments in user.config then after upgrade I restore it to Web.config from there.

Best,

Joe

11/10/2008 9:48:46 AM
Gravatar
Total Posts 20

Re: Location to persist custom machineKey

Joe,

Thanks for your quick reply.  I will add this information to the comments section of my user.config file.  I am not terribly concerned about restoring this information myself when I upgrade -- I am more concerned about what will happen if and when I hand the site off to someone else.

From looking further at the web.config and user.config information on your site, am I correct in assuming that only <appSettings> attributes can be read from user.config?

Lorien

11/10/2008 11:36:36 AM
Gravatar
Total Posts 18439

Re: Location to persist custom machineKey

Yes, thats correct, only appSettings section settings can be stored in user.config. Anything else has to be maintained in Web.config on each upgrade. So any customizations outside of appsettings should be also copied to a comment section in user.config to provide a place to recover it from.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.