【问题标题】:How to build old Silverlight project in Azure DevOps?如何在 Azure DevOps 中构建旧的 Silverlight 项目?
【发布时间】:2022-10-25 17:02:48
【问题描述】:

我们有一个旧的 Silverlight 项目,我们必须在开发现代替代品时对其进行维护。 对于构建和发布,我们使用 Azure DevOps。 在 Windows 2019 和 2022 保留在 Azure DevOps 的可用映像中之后,问题就出现了。使用 Silverlight 项目停止构建的 VS 版本。 Visual Studio 企业版 2019 16.11.32901.82 Visual Studio 企业版 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.

现在,为了解决建筑物的问题,我看到了两种可能的方法:

  1. 不知何故安装必要的VS版本。 我已经在互联网上搜索了所有内容,但找不到如何做到这一点。 在构建任务中,我设置了所需的版本,并且构建跳转到工作室的可用版本,因为系统中没有安装其他版本。

  2. 肮脏的黑客。尝试以某种方式安装扩展程序https://marketplace.visualstudio.com/items?itemName=RamiAbughazaleh.SilverlightProjectSystem&ssr=false#qna,希望该项目能够正常工作。 但话又说回来,在 Azure DevOps 中,我没有看到允许我执行此操作的工具。

    对于我的问题的可能解决方案,我将不胜感激。 谢谢你。

【问题讨论】:

    标签: silverlight azure-devops azure-pipelines


    【解决方案1】:

    您不能使用 Visual Studio 2017 或更高版本来构建旧的 Silverlight(v4 或 v5)项目 - 您必须继续使用 Visual Studio 2015。

    来源:https://learn.microsoft.com/en-us/visualstudio/releases/2017/vs2017-compatibility-vs

    此版本的 Visual Studio 不支持 Silverlight 项目。要维护 Silverlight 应用程序,请继续使用 Visual Studio 2015。

    在 Azure DevOps 中,实现此功能的唯一方法是设置您自己的 Windows 实例并安装 VS2015(或 VS2015 构建工具),然后安装 Azure DevOps 构建代理。该实例可以是本地或云托管的(Azure 甚至是 AWS VM 实例),只要它可以访问 Internet 以与 Azure DevOps 通信(如果您使用的是 DevOps,配置会有所不同)服务器)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-07
      • 2020-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      相关资源
      最近更新 更多