1

I've been trying to open a Silverlight 3 solution in Visual Studio 2010, but I've been getting the following error:

Unable to read the project file 'ESM.Visualization.csproj'. C:\Code\ESM\ESM.Visualization\ESM.Visualization.csproj(238,3): The imported project "C:\Program Files(x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on the disk.

I found that I didn't have Silverlight v3.0 but I couldn't find a way to get Silverlight 3.0 on my Visual Studio 2010, especially since I have Silverlight v4.0 already installed.

Jason L
  • 1,812
  • 2
  • 22
  • 43
  • Also [resolving-microsoft-silverlight-csharp-targets-was-not-found](http://stackoverflow.com/questions/3591369/silverlight-4-resolving-microsoft-silverlight-csharp-targets-was-not-found) is a useful link. – Shubh Apr 08 '14 at 07:04

1 Answers1

3

You must change your *.csproj file manually.

Open it in any text editor, navigate to the line with the incorrect code (number 238, I suppose) and check that it looks so:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />

Then change these lines, set the content of the second element to "v4.0":

<TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
vortexwolf
  • 13,967
  • 2
  • 54
  • 72
  • Will that have any adverse effects on the project? I was thinking about doing that, but I didn't want to accidentally break all the things. – Jason L Aug 29 '12 at 15:07
  • @Yawus, it will work the same if you edit the project settings by using the visual studio editor (select another version of Sivlerlight from the combobox). There is no magic: the default editor just changes the *.csproj file, nothing more. So you can do the same thing manually. – vortexwolf Aug 29 '12 at 15:10