Adding machineKey to machine.config

Rami Alhamad picture Rami Alhamad · Apr 26, 2012 · Viewed 29.6k times · Source

I would like to add the machineKey to my machine.config since I am working with programmatic encryption of web.config connection strings in a web farm scenario.

My question is, where do I place the machineKey in the machine.config file? There isn't one already there that I can replace, I suspect it's being autogenerated, so where should it be placed?

Answer

peroija picture peroija · Apr 26, 2012

just place it under <system.web>

if you need a key generated, i like to use the tool on this site: Machine Key Generator

UPDATE: The above link seems to be dead, here is another site to generate keys