I replaced all the machine keys on all my sites, still getting the same amount of viewstate mac failed error, plus I verified that each site is using a different one.
Since this looks like a fairly common problem everywhere I started trying different things to see if anything would help.
The one thing that seems to make a difference is generating the machine key on the shared server instead of a different machine. Not sure why but it seemed stop the error from happening. I do have 2 sites on the same machine so I always generated a new machinekey.
I created a page in /administration called GenerateMachineKey.aspx and added the following to the .aspx
publicpartialclass GenerateMachineKey : BaseNopAdministrationPage // <- dont forget to set this. { static RNGCryptoServiceProvider srng = new RNGCryptoServiceProvider(); // 64 bytes is max size supported by ASP.NET constint validationKeyLength = 64; // 24 bytes is max size supported by ASP.NET (3DES) constint decryptionKeyLength = 24;
staticstring GenerateKey() { StringBuilder sb = new StringBuilder(); sb.Append("<machineKey validationKey='");
Just got the error again, but seems to be a lot less then before. once out of 120+ errors, most are the image error on the product page and the This is an invalid webresource request.
I think it helped, ill still continue to keep an eye on it.
Just got the error again, but seems to be a lot less then before. once out of 120+ errors, most are the image error on the product page and the This is an invalid webresource request.
I think it helped, ill still continue to keep an eye on it.
-Keith
Please post the complete code because I am getting errors like - I am missing assemblies.
Plz post complete code of this page .aspx and .aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Security.Cryptography; using System.Text;
namespace NopSolutions.NopCommerce.Web.Administration { publicpartialclass GenerateMachineKey : BaseNopAdministrationPage { static RNGCryptoServiceProvider srng = new RNGCryptoServiceProvider(); // 64 bytes is max size supported by ASP.NET constint validationKeyLength = 64; // 24 bytes is max size supported by ASP.NET (3DES) constint decryptionKeyLength = 24;
staticstring GenerateKey() { StringBuilder sb = new StringBuilder(); sb.Append("<machineKey validationKey='");