Tuesday, 1 April 2014

The imported project "Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Silverlight 4.0 Projects not open in the Silverlight 5.0 installed machine and shows the below error
Error :
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 <Import> declaration is correct, and that the file exists on disk.



Solution:
In Silverlight V4.0 path has only  Microsoft.Silverlight.CSharp.targets file in the path, 
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0

but in Silverlight V5.0 has (C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0) below files,
1. Microsoft.Ria.Client.targets
2. Microsoft.Silverlight.Build.Tasks.dll
3. Microsoft.Silverlight.Common.targets
4. Microsoft.Silverlight.CSharp.targets
5. Microsoft.Silverlight.VisualBasic.targets
6. XamlServices.dll
7. zlib114.dll

I copied all the Missing files except  Microsoft.Silverlight.CSharp.targets  and pasted in v4.0 path. Now projects loads without an issue.