none
Silverlight 5 Projects does not build in TFS 2018 RRS feed

  • Question

  • I used Visual Studio 2015 to open an exsiting Silverlight project. Installed Silverlight 5 SDk and Silverlight 5 developer runtime.

    On local Vissual studio the projects runs with no errors.

     i added the project to an existing solutions with other projects. The other projects are of target framework 4.6.1.

    I have created a build template in TFS 2018 with path to the solution that has the Silverligjht projects with other projects.

    But the build task fails at the Silvrlight project with below error.

    Error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" was not found. Also, tried to find "Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.

    But the path of "Microsoft.Silverlight.CSharp.targets" on my system is C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\

    v5.0\Microsoft.Silverlight.CSharp.targets

    and the import element in the .csproj of the Silerlight project looks like this

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

      


    Saturday, August 10, 2019 2:28 PM

All replies

  • Hi Rajab,

    Welcome to the MSDN forum.

    It seems that you added your Silverlight project into a solution which developed by Visual Studio 2017. As far as l know, VS2017 does not support Silverlight project. So please try these steps:

      1. open your csproj file and change the path of the import node to the the correct path in your PC like 

         
     "C:\Program Files(x86)\MsBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.CSharp.targets"

      2. remember to check the Silverlight target version to v5.0

     

    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>

    >>>>If it does not work, please execute and build this project separately in VS2015. You can try to create a solution in VS2015 and add this existing project and then build.

    Any feedback will be expected.

    Best Regards,

    Perry




    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Monday, August 12, 2019 7:14 AM
  • Hi Rajab,

    Did your issue solved? Did you have any update? If this issue still persists, please feel free to let us know. 

    We are willing to help you further.

    Best Regards,

    Perry



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, August 13, 2019 9:13 AM
  • Hi Rajab Nisha,

    Sorry for bothering you. Any update for it?

    Did perry's suggestion work for you? And you could also try to copy the whole Silverlight folder to "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\" directory without modify the csproj file.

    And please try to re-install Microsoft Silverlight in your development environment.

    Hope it could help you.

    Best Regards,

    Dylan 


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, September 4, 2019 8:39 AM
  • Hi Dylan, 

    I didn't try Perry Qian, yet I'm having this problem on Azure pipline trying to build a solution that contain a silverlight project 
    getting similar error 
    ##[error]ReportViewer.vbproj(137,11): Error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Silverlight.VisualBasic.targets" was not found. Also, tried to find "Microsoft\Silverlight\v5.0\Microsoft.Silverlight.VisualBasic.targets" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.

    Before I used to download sliverlight sdk but microsoft killed the download link, I will try your fix hoefully it'll solve it.


    Tuesday, September 10, 2019 10:12 AM