[英]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 restore
, do.net build
, do.net test
等),指定的 .NET Core 版本将用于您的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.