Matt Sigman

Hands-On Software Leader

Matt Sigman - Hands-On Software Leader

Upgrading ASP.NET Web Application to Framework 4.5

When you’re first opening an application in VS2012 that targets some previous version of the framework (prior to version 4.5), a Project Compatibility wizard will open, prompting you to automatically update to the latest and greatest.

But what do you do if you cancel this wizard, but later decide to upgrade?

Turns out it’s very easy.  Just follow these few steps and VS2012 will take care of it for you.

  1. Open your Solution in Visual Studio 2012
  2. Right click on the first project, and choose Properties
  3. Choose .NET Framework 4.5 from the dropdown (see screenshot)
  4. Repeat for every project in your solution

Visual Studio will update the web.config and any other files that are necessary.  In other words, that’s all you have to do; easy!

If you run into any problems, see this article for help:

Setting element focus in a .NET 4.5 AJAX Application

This issue has been brought up again and again since .NET v1.0. However, even today it continues to be a problem. There are many ways one can try to set the element that has the focus when an ASP.NET page is first loaded:

Page.Form.DefaultFocus = Control.ClientID;

and so on…

However, none of them seemed to work for us. Our app has master pages, a slew of Telerik controls, and several JavaScript scripts loading with the page, but no matter what I tried I could not get the focus set to the control I wanted. In the end this was the only way that reliably worked across browsers:

Continue reading “Setting element focus in a .NET 4.5 AJAX Application” »

Intermittent error using MsDeploy and TFS: Directory is not empty

After setting up a continuous integration environment using TFS and MsDeploy to automatically deploy our ASP.NET Web Application during builds, we would intermittently receive the following error:

Web deployment task failed.(An error was encountered when processing 'E:\Dev7\App_Themes'.)An error was encountered when processing 'E:\Dev7\App_Themes'.  The directory is not empty.

Continue reading “Intermittent error using MsDeploy and TFS: Directory is not empty” »

Upgrading TFS 11 Beta to TFS 2012 RC

The upgrade should be smooth for most people.  I had an unfortunate experience because the OLAP cube in the Tfs_Analysis database had somehow become corrupted during our ~5 week Beta trial, but I didn’t know it until the upgrade wizard abruptly failed with this message:

XML parsing failed at line 131, column 950: Unexpected end of input. Errors in the metadata manager. An error occurred when instantiating a metadata object from the file, ‘\\?\D:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\vDimTestCaseOverlay.73.dim.xml’

And the process stops with no way to recover.  TFS is left in an inconsistent state, neither allowing the existing/old version to function, nor allowing the upgrade process to be restarted.  (Thank god for backups, which is what I had to do).  If anyone else finds yourself in this unfortunate situation, what I did to resolve it was to restore the 3 TFS databases from backups I’d taken before beginning (HIGHLY RECOMMENDED), and then completely delete the SSAS database/cube.  Then I re-ran the upgrade wizard and it completed without errors.

There were three additional errors I ran into which I believe are bugs in the 2012 RC:

Continue reading “Upgrading TFS 11 Beta to TFS 2012 RC” »