Upgrade to ASP.Net 4 on Web Farm

Recently we upgraded Web Farm web site to ASP.Net 4.
We studied .NET Framework 4 Migration Issues and, fortunately, didn’t found any serious issues, related to our site.

Before all sites will be converted to .Net 4, for forms authentication cookies to work across .NET Framework versions, we’ve added


<machineKey validation=”SHA1″ />

Tests were successfull on single computer, but when we started to test new version on Web Farm, we started to see intermittent strange errors.
Finally it was found, that the problem was that .Net4 has it’s own copy of machine.config, and machineKey validationKey=”0000…0000″ and decryptionKey=”00…00″ were not copied from  ASP.Net2 copy of machine.config
Note that “for a web farm, you want to manually put in your own keys and make sure they are EXACTLY THE SAME on each machine in the farm.”(Generate Machine Key Elements for Web Farms )


We had to manually copy <machineKey> entry to .Net4 copy of machine.config on each machine in the farm.