部署AntiforgeryToken错误 [英] deploying AntiforgeryToken Error

查看:1480
本文介绍了部署AntiforgeryToken错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我我的本地机器使用内置的IISEx preSS在Visual Studio 2012工作的一个ASP.NET MVC应用程序。我决定把它整个本地网络访问的显著的进步后,我从Visual Studio中创建一个虚拟目录。我可以登录,但是当我尝试注册一个新用户。我得到下面的错误。

I am working on an ASP.NET MVC application on my local machine using the Visual Studio 2012 built in IISExpress. After a significant progress I decided to make it available across the Local network, I created a virtual directory from visual studio. I can log in but when I try to register a new user. I get the error below.

的防伪标记不能被解密。如果这个应用程序是
  由主办
       Web场或群集,确保所有机器都运行相同版本的
       ASP.NET Web页面和配置明确规定
       加密和验证密钥。自动生成不能在集群中使用。

The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.

我产生距离( ASPNET资源)新机键并把它放在我的配置文件,但依然不working.Can有人提出一个解决方案?

I generated a new machine key from (ASPNET resources) and placed it in my configuration file but is not still working.Can someone suggest a solution?

推荐答案

有一件事我注意到的是,这种错误可能是由具有多个引起 @ Html.AntiForgeryToken() code片在页面上。我有2我的网页上,一旦我删除了第二个,这个错误就走开了。

One thing I noticed is that this error could be caused by having multiple @Html.AntiForgeryToken() pieces of code on the page. I had 2 on my page and once I removed the second one, this error went away.

这篇关于部署AntiforgeryToken错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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