在一台机器上创建并在另一台机器上运行的脚本 [英] Script created on one machine and run on another machine

查看:32
本文介绍了在一台机器上创建并在另一台机器上运行的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用我的机器为应用程序服务器创建了一个脚本,现在我想在其他机器上运行这个脚本,但是当我运行这个脚本时,我收到以下错误:

I have created a script for application server by using my machine and now i want to run this script on other machine, but when i am running this script, i'm getting following error:

视图状态 MAC 验证失败.如果此应用程序由Web Farm 或集群,确保配置指定相同的validationKey和验证算法.自动生成不能在集群中使用.

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

我如何使用这个脚本或者我应该在该机器上创建另一个脚本?

How can i use this script or should i create another script on that machine?

谢谢.

推荐答案

您是否正在尝试测试 ASP.NET 应用程序?

Are you trying to test ASP.NET app?

如果是,则假设您在测试中错误地处理了 VIEWSTATE:您需要关联请求中的 VIEWSTATE,以便将正确的值发送回服务器.

If yes then suppose you are incorrectly handling VIEWSTATE in your test: you need to correlate the VIEWSTATE in your request so that you're sending the correct value back to the server.

记录和重放方法在这里不起作用:如果您只是尝试使用脚本中记录的值,那么您可能会遇到问题.您需要做的是从服务器的先前响应中获取 VIEWSTATE 的值,将其剥离、编码然后发送回来.

Record and replay approach will not work here: if you're just trying to use the value recorded in the script then you're likely to run into problems. What you need to do is get the value of VIEWSTATE from the previous response from the server, strip it out, encode it and then send it back.

我可以查看链接数量和操作方法:https://stackoverflow.com/a/10650186/993246.

I can look into for number of links and how-tos: https://stackoverflow.com/a/10650186/993246.

这篇关于在一台机器上创建并在另一台机器上运行的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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