Silverlight 4: Microsoft.Silverlight.CSharp.targets permission not found?

I upgraded some Silverlight 3 applications to Silverlight 4 in Visual Studio 2010. My Silverlight 3 applications work fine in Visual Studio, but there is no following error in SL4 applications:

C:\Path\To\MyProject.csproj : error : Unable to read the project file 'XNTVOD.AdminClient.csproj'. C:\Path\To\MyProject.csproj(593,3): 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.

I had a problem with old VS Silverlight components and recently removed most of the SL components, and now in "Add or Remove Programs" I have:

  • Microsoft silverlight
  • Microsoft Silverlight 3 SDK
  • Microsoft Silverlight 4 Toolkit April 2010

The <import> declaration looks like this for the SL4 project:

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

There are only two files in this folder C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0 :

Microsoft.Ria.Client.targets

Microsoft.Ria.Client.VisualStudio.targets

Which Silverlight development component am I missing in particular? I see many different options: from Silverlight 4 SDK Beta to VS Tools for Silverlight 4 and several others. I do not want to install things that will return me back to the situation that I had before, with outdated components.

+49
visual-studio visual-studio-2010 silverlight
Aug 28 '10 at 15:46
source share
6 answers

Looks like this is the missing part ...

Silverlight 4 Tools for Visual Studio 2010

+42
Aug 28 '10 at 16:20
source share

A file that skips ships in the Silverlight 4 SDK. You can only install the Silverlight 4 SDK or reinstall all Silverlight 4 Tools for VS2010 (which reinstalls the developer runtime, SDK, patch for VS2010, Silverlight 4 Tools, and WCF RIA services).

+18
Aug 28 '10 at 16:29
source share

You can get this with Silverlight version 4 projects when you try to open in version 5 if version 4 bits are not on this computer. What worked for me (after several hours of trying everything) is to edit the csproj file and change the target version of silverlight

 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 

4 to 5

+11
Jun 29 '12 at 17:03
source share

This worked for me ... also had to install Silverlight 4 Developer runtime

+5
Nov 02 '11 at 18:43
source share

Afer many attempts, which worked for me: 1. go to add or remove programs 2. Uninstall all versions of Silverlight (4, 5 or even if no version is specified, uninstall it too!) 3. install Silverlight 4 SDK 4. install Silverlight 5 for developers Finally, the project opened in VS 2010 SP1

+4
Nov 07 '12 at 6:26
source share

A previously working installation may break when installing a new version of TFS on the server (or whatever it is related to my MSBuild).

My “target” files disappeared from C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0 on the 2012 server and reinstalled the tools.

I believe that you can simply copy target files from another computer, but not 100% sure.

0
Nov 23 '16 at 6:32
source share



All Articles