Monday, June 7, 2010

Unable to open Silverlight 4 projects in VS2010

Scenario:
I was trying new features of Silverlight 4 and got following error opening the project

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" was not found.
Confirm that the path in the declaration is correct, and that the file exists on disk.


Solution:
Reason is simple Visual Studio 2010 is missing the support for Silverlight 4, so you will need Silverlight 4 for VS 2010 to be able to make it work

1. Google for 'Web Installer 2.0'
2. Download and install it.
3. Now launch the Web Installer and look for Silverlight 4 add-on for Visual Studio 2010.
4. Select it and install it.

Just in case Web Installer is not able to install the component or you want to download the Silverlight 4 tools for VS 2010. You can get it from this here

3 comments:

Sebastien Giroux July 19, 2010 at 8:08 AM  

Updated link for the Silverlight 4 tools:
http://www.microsoft.com/downloads/details.aspx?FamilyID=40ef0f31-cb95-426d-9ce0-00dcfabf3df5

Mohammad Iqbal February 11, 2011 at 1:35 PM  

you just need to copy Mirosoft.CSharp.target from v3.0 folder to 4.0

thats it it will work

Mohammad Iqbal February 11, 2011 at 1:36 PM  

you just need to copy Mirosoft.CSharp.target from v3.0 folder to 4.0

thats it it will work