How to build old Silverlight project in Azure DevOps?

Viewed 10

We have an old Silverlight project that we have to maintain while a modern replacement is developed. For build and publication, we use Azure DevOps. The problem arose after Windows 2019 and 2022 remained in the available images of Azure DevOps. With versions of VS with which the project with Silverlight stopped building. Visual Studio Enterprise 2019 16.11.32901.82 Visual Studio Enterprise 2022 17.3.32901.215

2022-09-10T14:26:05.9397408Z ##[error]abcWebSilverlight\abcWebSilverlight.csproj(1056,11): Error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\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\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.

Now, to solve the problem with the building, I see two possible ways:

  1. Somehow install the necessary VS version. I've googled all over the internet but can't find how to do it. In the Build task, I set the desired version and the build jumps to the available version of the studio because others are not installed in the system.

  2. Dirty hack. Try to somehow install the extension https://marketplace.visualstudio.com/items?itemName=RamiAbughazaleh.SilverlightProjectSystem&ssr=false#qna in the hope that the project will work. But then again, in Azure DevOps, I don't see a tool that allows me to do this.

I would appreciate any advice on a possible solution to my problem. Thank you.

0 Answers
Related