ASP.NET服务器迁移 [英] ASP.NET Server Migration

查看:155
本文介绍了ASP.NET服务器迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有我们从运行Windows 2005 + IIS 6中运行Windows 2008 + IIS7一个虚拟的物理服务器移动长寿ASP.NET 3.5应用程序。新机将承担识别旧的 - IP的,DNS等

我们的客户保持我们的几个小时的网站上 - 有时甚至几天。我担心的是,当我们使这个切换过来,顿时所有的thier viewstates将无法验证,因为将machineKey中已经改变。

就是这种破坏可以避免的?我不能设置新服务器的machineKey中是一样的一个在现在使用?我认为这是自动生成的 - 我可以找出它是什么

或者是这甚至值得的 - 这是一个吸它向上的情况,用户不应该期望能够打一个网站那么久


解决方案

 <&的System.Web GT;
    <的machineKey的validationKey =生成你自己的decryptionKey =验证=3DES/&GT在自己的生成;
< /system.web>

您是正确的,移动将全部无效授权饼干。我相信,除非你有ViewState的加密打开,视图状态将被罚款。

如果您添加的machineKey属性的话,那不要紧,网站托管,只要这台机器的关键是一样的,加密和解密将被罚款。此外,您将需要/应该使用这个,如果你的网站是在负载均衡的环境中举行。

msdn.microsoft.com/en-us/library/ms998288.aspx

We have a long-lived ASP.NET 3.5 application we are moving from a physical server running Windows 2005+IIS 6 to a virtual one running Windows 2008+IIS7. The new machine will assume the identify of the old one - IP's, DNS, etc.

Our clients keep our site up for hours - sometimes even days. My fear is that when we make this switch-over, suddenly all thier viewstates will fail to validate because the MachineKey will have changed.

Is this kind of disruption avoidable? Can I 'set' the new server's machineKey to be the same as the one in use now? I think it is autogenerated - can I find out what it is?

Or, is this even worth it - is this a suck-it-up situation where users shouldn't expect to be able to hit a website for that long?

解决方案

<system.web>
    <machineKey validationKey="Generate on your own" decryptionKey="Generate on your own" validation="3DES"/>
</system.web>

You are correct, moving will invalidate all Authorization Cookies. I believe, unless you have viewstate encryption turned on, viewstate will be fine.

If you add the machinekey attribute, then it doesn't matter where the site is hosted, as long as that machine key is the same, encryption and decryption will be fine. Additionally, you will need to/should use this if your site is hosted in a load balanced environment.

msdn.microsoft.com/en-us/library/ms998288.aspx

这篇关于ASP.NET服务器迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆