Wednesday, October 3, 2012

TFS WebAccess Error: [HttpException (0x80004005): Unable to validate data

We were getting the following error while setting our TFS2010 Web access. Sharing the solution which worked for us, might be useful for you.

[HttpException (0x80004005): Unable to validate data

1. On App Tier server, goto C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web.
    (Please make a copy of Web.config, just in case you need the original file later.)

2. Edit the Web.config file in notepad.
3. Search "machineKey" in Web.config file.
4. Replace the <machineKey> section with following.
<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
5. Save the Web.config file.
6. Restart the Microsoft Internet Information Services (IIS) service.

TFS Web Access Error: Microsoft.TeamFoundation.WebAccess.Common.dll was invalid

I was getting this error when setting up TFS 2010 web access. I searched a lot but didn't find any solution, finally after lot of R&D I was able to fix this issue.
I may be useful for others who face this error:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: The given assembly name or codebase, 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.TeamFoundation.WebAccess.Common\\Microsoft.TeamFoundation.WebAccess.Common.dll', was invalid.

We get the following error due to IIS_IUSRS a/c is missing some group policies.
"'C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.WebAccess.Common\\ Microsoft.TeamFoundation.WebAccess.Common.dll'
Here is what we need to do:
On App Tier->Start-Run- gpedit.msc -> Computer Configuration->Windows Setting->Security Setting->Local Policy->User Rights Assignment
Add the IIS_IUSRS a/c to the following policies:
    • Bypass Travers Checking
    • Impersonate a client after authentication
    • Log on as batch job
We were faced this issue two times in our differrent environment. And the above solution fixed it for both. So it's worth a try.