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:
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.
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.
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.
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
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.
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.
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.
Hope it helps.
As 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:
- Download Visual Studio 2010.
- Read blogs.
- Watch shows.
- And of course Google.
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.
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.
To import the Expression theme, install the Visual Studio Color Theme Editor extension and then import the file from the Customize Colors dialog.
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.
PS: If you enhance this theme, then please share.
- Fixed tool window button colors.
- Fixed dropdown & combobox colors.
- Fixed panel tab hover colors.
- Fixed command bar colors.
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.
- Delete all the files from the following locations
- Pin all the required items again.
Hope it helps.
Windows 2008 & Visual Studio Web Setup: The installer was interrupted before ApplicationName could be installed
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.
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.”
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.
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.