简体   繁体   中英

Any risk with using same machinekey in Web Farm

My ASP.NET application encountered "Validation of viewstate MAC failed" error. As a solution, I want to use same machine key in the web.configs across all servers in the Web Farm. My concern is that, if I use the same machinekey across servers, does it going to break anything? Is there any risk on using same machinekey across servers ?

If you are using load balancing you must use the same machine key, there is not workaround. If you are load balancing just one application, it is recommended to add machinekey to Web.config file instead of machine.config. See this article on MSDN for more details (although it is targeted for .NET 2.0 the same principles should still be valid)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM