Sunday, January 23, 2011

Reloading project feature finally makes it to Visual Studio 2010

For those of you who have ever worked with Visual Studio 2010 or earlier, you must have encountered the "Reload project" dialog in Visual Studio.  This message appears whenever you have made modifications to the Visual Studio project file, either by hand editing the project file in an external editor or simply downloading a newer version of the project file from source control.

The main problem with this dialog is that you are prompted for each and every project reload within the solution.  This can be extremely annoying when you have a particularly large solution to have to answer a dozen or more prompts one after the other.  My workaround in the past has been to simply close the solution and then re-open the solution once again.

Well, with the latest release of VSCommands, that is an issue no longer!  You now have the option to Reload All projects in a single action and avoid those dozens upon dozens of dialog prompts.

The release notes for VSCommands can be found here:

You can download the latest (free) version of VSCommands from the Visual Studio Gallery here:

Upgrading Sitefinity v. 3.7 to .Net Framework v. 4.0

Sitefinity v. 3.7 was recently updated to support Microsoft.Net Framework v. 4.0 with the release of SP4.  If you currently host your ASP.Net Web Sites on shared hosting providers such as Discount ASP.Net or, you will probably want to update your version of Sitefinity for .Net Framework v. 4.0 support so that it works properly on these hosted platforms.

In order to do this, there are several steps that you must follow:

  1. Make sure that your local development workstation or hosting provider has .Net Framework v. 4.0 installed/supported
  2. From the website, download the Sitefinity v. 3.7 SP4 patch for .Net Framework v. 4.0 called
  3. Prior to performing the update, make sure that you back up your current v. 3.7 website and web.config file.
  4. Now, extract the contents of the .zip file that contains the patch
  5. Copy the contents of the .zip file over the existing directories in the v. 3.7 website
  6. Using a comparison tool such as Beyond Compare, compare the contents of the new_web.config with the existing web.config
  7. Make sure that any customizations in the old web.config are applied to the new_web.config
  8. Save the changes to the new_web.config file
  9. Rename the old web.config file to web.config.bak
  10. Rename the new_web.config to web.config
  11. Now, if you are running on a platform such as Windows Server 2008 or Windows Server 2008 R2, you will need to change the currently running Application Pool assigned to the website/virtual directory.  
  12. The appropriate Application Pools for the .Net Framework v. 4.0 are ASP.NET v4.0 and ASP.NET v4.0 Classic
  13. Depending on your requirements you will either use one of these existing Application Pools or else you will create a new Application Pool to assign to the website/virtual directory
  14. In the Application Pool settings, make sure you assign the appropriate user identity.  For example, by default, ApplicationPoolIdentity is used for Windows Server 2008 R2.  However, this privilege is unhandled by most applications including Sitefinity.  Therefore, you will have to switch it to another account such as NetworkService
  15. Now load your upgraded Sitefinity v. 3.7 website and verify that it is correctly running under .Net 4.0
  16. If it works without any error messages, you have succeeded in getting your Sitefinity v. 3.7 website to run under .Net 4.0!

Wednesday, January 12, 2011

Windows Virtual PC vs. VMWare Workstation

If you have been using virtualization for a long time, in all likelihood, you have been using VMWare Workstation.  Therefore, if you are like me, you probably have never considered using Virtual PC in the past. 

However, today I was working with a colleague and he had decided to use Virtual PC.  After all, he was running Windows 7 x64, and Virtual PC for Windows 7 was a very small download, so why not?
After he installed Virtual PC, he attempted to create a Virtual Machine using Windows 7 x64 as a Guest OS.  However, as soon as he attempted to build the virtual machine from the Windows 7 x64 ISO image, he got the following error message: "Attempting to load a 64 bit app but this CPU is not compatible with 64 bit mode".  Well, I had seen this error message before in my days of building VMWare Workstation VMs, so I thought about checking the BIOS and verifying that Intel Virtualizaiton technology was enabled on his system. 

Interestingly enough, the Intel Virtualization technology WAS ENABLED in his BIOS.  Therefore, we restarted and tried it again.  Same error message--That was strange.  So I did some further digging and discovered that Windows 7 Virtual PC does not support 64-bit Guest VMS!  As it turns out, this is a limitation enforced specifically by Microsoft and therefore, one can only run 64-bit Guest VMs if you are running Windows Server 2008 with Hyper-V.

Therefore, if you are planning to run 64-bit Guest VMs on your Windows 7 workstation, stick with VMWare Workstation or Player. 

Saturday, January 8, 2011

Using the TFPT Scorch command

For those of you who are not familiar with TFPT, TFPT stands for Team Foundation Power Tools.  For functionality that is not available directly through Team Foundation Server, one can install the Team Foundation Power Tools (which are available for download from the Visual Studio Gallery).

Two of the especially useful options in TFPT are the treeclean and the scorch commands.

The other day, I wanted to use the scorch command so that I could ensure that the source code that I had on disk was identical to the code stored in TFS Source Control.  However, one of the problems that I encountered was that I needed to pass login credential information in order to execute the command and wonder of wonders, there was no documentation on how to do it!

So, after doing some searching on the Internet, I finally came up with a viable solution:
Use the /login switch in the format /login: <domain>\username,password

Therefore, in order to use the command so that I could get it to work properly, I used the following format:
tfpt scorch <local workspace path> /recursive /login:<domain>\username,password /noprompt

It is worthwhile to note that the tfpt command is not registered in Path Variables, therefore, you will not be able to execute this at any old command prompt.  Instead, you must open a Visual Studio Command Prompt to execute this command.

Hope that helps!