When I use @Html.AntiForgeryToken()
in a form whose action is in the same project, it works perfectly. However, if the action place for the form is in a different project within the same solution, I get the following error:
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 <machineKey>
configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.
Is there a way to use AntiForgeryToken between different projects?