Posts

Showing posts from January, 2012

ASP.NET error when sending email: 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.

I came across this error after deploying a website:


Server Error in '/' Application.
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.
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.Web.HttpException: 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.
Quite a nasty looking one but with a very simple fix - just need to add the following to your web.config file in the system.web section:
 <pagesvalidateRequest="false"enableEve…

VS2010 - Ctrl + Click: Installing Microsoft Productivity Power Tools

Image
The worst thing about developing in Java is the IDE's - Eclipse and Netbeans just don't compare to Visual Studio. However the one thing they do allow you to do is press control and click to take you to a definition - something severely lacking from VS...until now!

Productivity Power Tools is an extension for Visual Studio 2010 which contains ctrl + click among other helpful tools. To install this tool follow these steps:


In VS click the tools option on the toolbar, and select Extension Manager...
You will now be shown the extension manager dialog. Select the "Online Gallery" dialog on the left handside, and in the top right hand side search box enter "Productivity Power Tools". 
Press download and the download/installation process will start. Press install at the prompt. Once complete you will be notified that you need to restart VS. Press "Restart Now". 
Note that restarting VS may take a while depending on the speed of your machine. Once you restart…