enableViewStateMac Error

754 views Asked by At

My site is hosted on Windows 2012 VPS with IIS 8.0, it's a WebFarm Cluster Hosting, So I have Generate Unique Machine Key from my IIS Machine Key option and place it to my web.cofig file to avoid MAC error. My site is run on .Net 4.5 frame work.

Here is my Web Config details:

 <system.web>
<compilation debug="true" targetFramework="4.5">
  <assemblies>
    <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />   
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Auto" enableViewStateMac="true" />
<machineKey decryption="Auto" decryptionKey="9D4BF0A4DB5FD64D08DE303EFBC34DF14069261E34362EE1,IsolateApps" validation="SHA1" validationKey="67BF062C35944A7688EF9270DADD5A6535B6B2D143BCE4C6FD5F814FD1AF84196C5C4E852E204E1A98EDA02DD509964973EE26C7F37D5B018E2AB692A15722EA,IsolateApps" compatibilityMode="Framework45" />
<customErrors mode="Off" defaultRedirect="404.aspx">
  <error statusCode="403" redirect="404.aspx" />
  <error statusCode="404" redirect="404.aspx" />
</customErrors>

But during run time it is showing error mention below: enter image description here

Anybody is there to short this problem out. Thanks

1

There are 1 answers

0
Sergey Litvinov On BEST ANSWER

If you are specifying machine key with specific keys then you don't need IsolateApps word and it should be like this:

<machineKey decryption="Auto"
     decryptionKey="9D4BF0A4DB5FD64D08DE303EFBC34DF14069261E34362EE1" 
     validation="SHA1" 
     validationKey="67BF062C35944A7688EF9270DADD5A6535B6B2D143BCE4C6FD5F814FD1AF84196C5C4E852E204E1A98EDA02DD509964973EE26C7F37D5B018E2AB692A15722EA" 
     compatibilityMode="Framework45" />

IsolateApps needs in case if autogenerated key is used and it means that each application should have own autogenerated key. But in case of hardcoded keys it hasn't any sense and should be removed.