0

我对此做了一些研究并尝试插入:

<machineKey decryptionKey="A4B12CCDD50E95F8GB9GFH6JKAT4Y0U0I2OF2DF2AAFE5AB46189C,IsolateApps" validation="AES" validationKey="480CDF2AS9S9AS5CFDGF0GHFH9JJH4KHKAKLJ2L9F3SAS82A6C16911A29EF48903783F94529C21570AACB72766FB38CD4CE7B85B0ACE3149DC5FC1CCF1AA1CECE3579659996593B06,IsolateApps"/>

作为此错误的解决方案:

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

这次我得到一个错误。

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

然后它在 Config 源代码中标记出这一行:

<add name="DemographicDBEntities" connectionString="metadata=res://*/DemoGraph.csdl|res://*/DemoGraph.ssdl|res://*/DemoGraph.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=207.27.57.76,1433;initial catalog=DemographicDB;persist security info=False;user  id=west;pwd=westhouseit;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<machineKey decryptionKey="A4B12CCDD50E95F8GB9GFH6JKAT4Y0U0I2OF2DF2AAFE5AB46189C,IsolateApps" validation="AES" validationKey="480CDF2AS9S9AS5CFDGF0GHFH9JJH4KHKAKLJ2L9F3SAS82A6C16911A29EF48903783F94529C21570AACB72766FB38CD4CE7B85B0ACE3149DC5FC1CCF1AA1CECE3579659996593B06,IsolateApps"/>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>

机器钥匙标签的结构是否良好?我把它单独放在一个标签里。我将应用程序托管在在线主机上,因此无法使用 IIS 7.0 生成任何机器代码。我提出了几张票,但无济于事。感谢您的帮助。

4

3 回答 3

1

我相信问题在于 IIS 无权访问您的 webconfig 文件。

试试这个,如果它不起作用,请查看下面的链接,看看您是否可以尝试解决您的问题。

1.Open control panel
2.Click on” program” link (not uninstall programs)
3.Click” turn windows features on/off” link
4.locate” Internet Information services IIS” in the pop up window and expand its node
5.Expand the” World Wide Web Service” node
6.Expand “Application Development Features” node
7.check the check box of”ASP.NET”
8.Then click ok button

下面是一个非常有趣的链接,可以帮助您:

http://support.microsoft.com/kb/942055

于 2012-08-13T14:49:05.230 回答
1

I don't think you can manually specify the key and include the IsolateApps option. It must be Autogenerate,IsolateApps or a specific value without the IsolateApps option.

See the MSDN documentation for details.

于 2012-08-13T14:49:40.507 回答
1

Below is a link to a bug report that references Windows 2003 and .Net framework 3.5 and a web garden setup.

Nothing says that the problem is restricted to Win 2003 or even framework 3.5. In a web garden situation, one can imagine that the viewstate errors would happen VERY frequently, not just when the pool recycles (as we experienced).

http://connect.microsoft.com/VisualStudio/feedback/details/412881/net-3-5-installer-breaks-web-gardens-when-used-with-custom-application-pool-identity

To fix the metabase and registry permissions issues, we simply executed the following on our web server:

\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -ga domain\useraccount

We then recycled the app pool one more time to regenerate the viewstate validation key.

Whether or not this works in your situation will depend on specific details of your situation.

于 2012-08-13T15:06:43.213 回答