Thursday, 14 February 2008

Error in VSTS 2008 caused by installing GAX & GAT

Could not load file or assembly 'Microsoft.VisualStudio.TemplateWizardInterface,Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of itsdependencies. The located assembly's manifest definition does not match theassembly reference. (Exception from HRESEULT: 0x80131040)

This is due to some assembly redirects that are added to the devenv.exe.config file by installing the GAX (Guidance Automation Extensions).

Here is the fix, and it's an easy one:
1) Navigate to: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE in Windows Explorer
2) Load devenv.exe.config in your favorite text editor.
3) Find this string: "Microsoft.VisualStudio.TemplateWizardInterface"
4) Comment out the element so it looks like this:

5) Restart Visual Studio 2008. All fixed!

Wednesday, 13 February 2008

WebForm_PostBackOptions is undefine

Recentily I have migrated one of web project to Visual Studio 2008(ASP.Net 2.0) from Visual Studio 2003(ASP.Net 1.1) . After converting the application I was getting javascript error WebForm_PostBackOptions is undefine .

If custom HttpModule is written in your application then you have to check for the relativePath of the request in PreRequestHandlerExecute delegate. If the relativePath contains WebResource.axd then just return.

string relativePath=HttpUtils.GetRelativePath(application.Request.ApplicationPath, application.Request.Path);

if ("/webresource.axd".Equals(relativePath.ToLower()))
{
return;
}