简体   繁体   English

Azure Devops CI 管道未显示在代理任务下构建项目的 Net 选项

[英]Azure Devops CI pipeline not showing .Net option to build a project under Agent tasks

I am practicing Azure CI/CD pipeline and setting up a build pipeline.我正在练习 Azure CI/CD 管道并设置构建管道。 I was following the tutorial on which has a project in.Net Core while my project is in.Net 4.72.当我的项目在 .Net 4.72 中时,我正在关注在 .Net Core 中有一个项目的教程。 For creating a task for Restore Nuget and Build I could not find option for ".Net".为了为 Restore Nuget 和 Build 创建任务,我找不到“.Net”的选项。 I only found.Net Core.我只找到.Net Core。 Nevertheless I selected the.Net Core to complete the CI pipeline and when I did the build I got the below error which seem to be due.Net Core version.尽管如此,我还是选择了 .Net Core 来完成 CI 管道,当我进行构建时,我得到了以下错误,这似乎是由于 .Net Core 版本。

在此处输入图像描述

MSB4019: The imported project "C:\Program Files\do.net\sdk\5.0.408\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. MSB4019:找不到导入的项目“C:\Program Files\do.net\sdk\5.0.408\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets”。 Confirm that the expression in the Import declaration "C:\Program Files\do.net\sdk\5.0.408\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.确认导入声明“C:\Program Files\do.net\sdk\5.0.408\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets”中的表达式正确,并且该文件存在于磁盘。

You can try using the Use .NET Core task to specify the version of .NET Core required in your project.您可以尝试使用Use .NET Core 任务来指定项目中所需的 .NET Core 的版本。

This task will acquire the specified .NET Core version from the Inte.net or the tools cache and add it to the PATH.此任务将从 Inte.net 或工具缓存中获取指定的 .NET Core 版本并将其添加到 PATH 中。

Then, in the subsequent .NET tasks (such as do.net restore , do.net build , do.net test , etc..), the specified .NET Core version will be used for your project.然后,在后续的 .NET 任务中(如do.net restoredo.net builddo.net test等),指定的 .NET Core 版本将用于您的项目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .net 核心单元测试项目未能在 Azure Devops 管道中构建 - .net core unit test project failing to build in Azure Devops pipeline 构建 .NET 5.0 项目 Azure DevOps 流水线 - Building .NET 5.0 project Azure DevOps pipeline 添加对常见项目Azure DevOps构建管道的引用 - Add reference to Common project Azure DevOps Build Pipeline 如何在 Azure DevOps 管道中为 .net 构建设置 output 路径 - How to set output path for .net build in Azure DevOps Pipeline 是在自托管 Azure DevOps 代理上安装 dotnet SDK 更好,还是在构建管道中添加 UseDotNet@2 任务? - Is it better to install dotnet SDK on self-hosted Azure DevOps agent, or add the UseDotNet@2 task in the build pipeline? 无法使用 CI 管道从 Azure DevOps 中的外部 Git 触发源代码的自动构建 - Unable to trigger automatic build of source code from external Git in Azure DevOps Using CI pipeline .net 核心管道 azure devops - .net Core Pipeline in azure devops 如何为 Azure Function App 的 .NET 项目设置 Azure DevOps CI/CD - How to setup Azure DevOps CI/CD for .NET project for Azure Function App 使用 azure devops 构建 .net 核心项目。 我想控制使用的 sdk/runtime,将我的 sdk/runtime 添加到哪个位置以供代理拾取? - using azure devops to build .net core project . I want to control the sdk/runtime used, which location to add my sdk/runtime for agent to pickup? Azure DevOps 为 Winforms 应用程序构建 PIpeline - Azure DevOps Build PIpeline for Winforms Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM