0

I have a classic asp application hosted on IIS inside a docker container. This is being hosted on App Service in Azure Cloud.

I am successfully able to hit the app service URL and access the web page and login into the same. But if I am adding this app service behind an Application Gateway I am facing the following error.

Server Error in '/' Application. 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.

This link suggests adding MachineKey. But as the IIS is in the docker container, wondering if there is a way to achieve the same or if is there any way to overcome the above-mentioned error.

Adding machineKey to web.config on web-farm sites (https://stackoverflow.com)

My expectation is when I try to access the classic asp application through Application Gateway, the login page should work as expected.

Aditya Ch
  • 100
  • 7

1 Answers1

0

Just kindly add this link to your web.config file:

<pages enableEventValidation="false" viewStateEncryptionMode="Never" />

OR

if you don't want this solution to implemented on project level then you can add these attribute to the page(Top most line of HTML view) directive of the page which is creating issue.

That means you have to add enableEventValidation="false" viewStateEncryptionMode="Never" in page directive.