Zuhaib

A very lazy but meticulous blogger

ASP.NET WebApplication Fails To Load In Visual Studio 2008 After Upgrading In Visual Studio 2010

with 4 comments

Today after upgrading a ASP.NET Web Application project in Visual Studio 2010 the project failed to load in Visual Studio 2008. If the machine has both VS2008 and VS2010 installed then the project loaded just fine. But, if a machine does not has VS2010 installed the Web Application failed to load.

After the upgrade Visual Studio 2010 modified the following:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
TO
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

Because the v10.0 (second) path is not present in machines that do not have V2010 installed, VS2008 was unable to load the project.

After googling I came across this post which tells to use MSBuild’s condition statements to specify the correct path based on the the Visual Studio version. His solution worked fine, the only problem that I faced was when I open the solution in VS2010, it again asked to upgrade the project file, doing which changed the v9.0 path to v10.0 path.

I had to make few minor changes to solve this problem:

Step1:

Add the V10.0 path before the V9.0 MSBuild extension path with a Condition property to check for the file based on the Solution Version.

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '10.0'" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" Condition="'$(Solutions.VSVersion)' == '9.0'" />

Here is we do not specify the Visual Studio 2010 MSBuild extension path first the Visual Studio will try to upgrade the project.

Step2:

After the project file upgrade VS2010 would have changed the FileUpgradeFlags tags value to 0, which would again trigger an upgrade. Remove the Zero from the tag.

<FileUpgradeFlags></FileUpgradeFlags>

Save the project file and reload. Now you will be able to load the project in VS2010 & VS2008 (Even if VS2010 is not installed) without any problem.

Hope it helps.

Written by Zuhaib

May 18th, 2010 at 11:30 am

Visual Studio 2010: Installing MSDN Documentation

with 9 comments

Like me if you also forgot to install the MSDN documentation while installing Visual Studio 2010 then don’t worry, it can be installed afterwards.

Step 1: Open Help Library Manager

Launch Visual Studio 2010 then click on Help » Manage Help Settings

Open Help Manager

It will bring up the Select Location dialog box. You can change the documentation path here, if you want to. But the default path should be ok. Click on Ok button to continue to next dialog.

Step 2: Install From Disk

In this dialog box click on Install content from disk link. Then locate the locate the HelpContentSetup.msha manifest file under the CDROM » ProductDocumentation folder and click Open.

Install content from disk Choose the manifest file

Step 3: Select Contents To Install

In this dialog box choose what help contents you want to install by clicking on the Add link in the Action column. Click on the Update button to start installing.

Choose the contents to install Install the content

When the installation is finished click on Finish button to close the dialog box.

Step 4: Choosing Preferred Help Location

At this point the MSDN documentation are installed on your system, but the Visual Studio is using the online help as the main source. To use the local help contents, follow Step 1 to open the Help Library Manager. Click on Settings, then click on the I want to use local help option button and click Ok.

 Choose local help as the default source

Hope it helps.

Written by Zuhaib

April 28th, 2010 at 3:46 pm

Posted in Visual Studio

Tagged with , , ,

Visual Studio 2010 Dark Expression Blend Color Theme

with 82 comments

image_thumb_04B9B051_thumbAs you guys might already know, that Visual Studio 2010 & .NET Framework 4.0 has been released. All of the latest development tools from Microsoft are full of awesomeness. If you haven’t already got your hands on the latest version of Visual Studio, then below are few links that can get you started:

My Visual Studio Color Scheme

I have always preferred working in dark color schemes, but because the color of visual studio 2005 & 2008 was light, it was difficult to get a complete dark working environment.

But as the new Visual Studio IDE is built using WPF, we can customize the theme of the IDE using the Visual Studio Color Theme Editor. This is one of my favorite extensions for Visual Studio 2010. The extension comes with few built-in color schemes, that are actually quite good. But, I wanted my IDE to be more like Expression Blend. So, I have created my own theme for Visual Studio 2010, which is not yet complete. But, if you like it then give it a try.

Dark:

Visual Studio 2010 Expression Theme

Some parts of the Visual Studio IDE like the Solution Explorer, Property Window, Scroll Bars etc are rendered natively (your current windows theme). So, there is no way (that I know) to customize the color of those particular parts of the IDE.

Download

To import the Expression theme, install the Visual Studio Color Theme Editor extension and then import the file from the Customize Colors dialog.

import_theme

Gray:

The author of the extension has given detailed explanation about how to create the lighter version of the Expression Blend theme on his blog. Check out his post here or click here to download the gray theme.

Visual Studio 2010 Expression Theme

PS: If you enhance this theme, then please share.

Update (05/03/2010):

  • Fixed tool window button colors.
  • Fixed dropdown & combobox colors.

Update (05/20/2010):

  • Fixed panel tab hover colors.
  • Fixed command bar colors.

Written by Zuhaib

April 18th, 2010 at 5:30 pm

Windows 7 Jumplist Disappear

with one comment

Recently my Windows 7 jumplist disappeared. I tried pinning each item again, but nothing appeared. If you are facing the same issue, then follow the following simple steps to restore Windows 7 Jumplist capabilities.

Warning: All you existing jumplist items will be removed. You need to pin each item again.

Fix

  • Delete all the files from the following locations
    %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations
    %APPDATA%\Microsoft\Windows\Recent\CustomDestinations
  • Reboot
  • Pin all the required items again.

Hope it helps.

Written by Zuhaib

April 2nd, 2010 at 12:10 pm

Posted in windows

Tagged with , ,

Windows 2008 & Visual Studio Web Setup: The installer was interrupted before ApplicationName could be installed

with 12 comments

Although how much I hate creating setup packages, I had to create a few setups for some of my projects recently. While I was working on setup projects, I found that, the capabilities of Visual Studio Setup & Deployment projects are shockingly limited, and not to mention I faced a lot of issues while creating setup projects in Visual Studio. Few people suggested me to use WiX. WiX certainly is good and far more flexible solution for building Windows Installer Setup Packages, but it has got a very steep learning curve.

I will be making few posts in future about the problems, that I faced during my experience creating setup packages using Visual Studio. So, here you go. Here is the first problem.

The Problem

I was working on a simple Web Setup project in Visual Studio 2008. The setup worked fine in XP & Windows 2003 server. But, when I tried installing the setup in Windows Server 2008, I got this nice error message that said. “The installer was interrupted before <MyApplicationName> could be installed. You need to restart the installer to try again.” :(

Installation_Incomplete

Having faced many problems earlier with msi packages, I at least knew how to start the msi package in verbose mode to create the log files.

Launch your msi in verbose mode:

msiexec /i yoursetup.msi /lv "C:\yourdirectory\logfile.txt"

I searched for terms like “ERROR” & “FATAL” in the log file :). I got this.

Action ended 15:57:43: WEBCA_MYSETUPTARGETVDIR. Return value 1.
MSI (c) (8C:20) [15:57:43:204]: Doing action: WEBCA_SetTARGETSITE
Action start 15:57:43: WEBCA_SetTARGETSITE.
MSI (c) (8C:20) [15:57:43:206]: Note: 1: 2235 2:  3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'WEBCA_SetTARGETSITE' 
MSI (c) (8C:A0) [15:57:43:226]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\1\MSI4225.tmp, Entrypoint: SetTARGETSITE
INFO   : [03/31/2010 15:57:43:286] [SetTARGETSITE                           ]: Custom Action is starting...
INFO   : [03/31/2010 15:57:43:287] [SetTARGETSITE                           ]: CoInitializeEx - COM initialization Apartment Threaded...
ERROR  : [03/31/2010 15:57:43:290] [SetTARGETSITE                           ]: FAILED:    -2147221164
ERROR  : [03/31/2010 15:57:43:291] [SetTARGETSITE                           ]: Custom Action failed with code: '340'
INFO   : [03/31/2010 15:57:43:293] [SetTARGETSITE                           ]: Custom Action completed with return code: '340'
Action ended 15:57:43: WEBCA_SetTARGETSITE. Return value 3.
MSI (c) (8C:20) [15:57:43:297]: Doing action: FatalErrorForm
Action start 15:57:43: FatalErrorForm.

I could see that the action WEBCA_SetTARGETSITE was failing. But I had not idea what was wrong, except that the term itself said Set Target Site failed. So I turned up to Google and landed on this blog post.

So the real problem is that my setup is unable to get the “Default Web Site” from IIS7.

The Solution

RoleManager I installed the “IIS6 Metabase Compatibility” role using Role Manager as mentioned in the blog post and my setup started working. Existing software & scripts can interface with IIS7 only if the Metabase compatibility component is installed in IIS7.

 

 

Thanks to Galin Iliev.

Written by Zuhaib

March 31st, 2010 at 10:50 am