azure – 使用VSTS的ASP.NET Core Web API的CI/CD

我使用Visual Studio 2017(Community Edition)创建了一个ASP.NET Core Web API应用程序。我可以使用Visual Studio成功发布到Azure App Service。

我现在想要使用VSTS设置CI / CD。我使用了Visual Studio中的“配置持续交付”选项,该选项在VSTS中创建了一个项目并创建了一个构建定义。我必须在VSTS中基于’ASP.NET Core’模板创建一个新的构建定义,以避免Nuget恢复错误。现在构建解决方案并运行测试但“发布”任务完成并发出警告 –

##[warning]No web project was found in the repository. Web projects are identified by the presence of either a web.config file or wwwroot folder in the directory.

“发布工件”任务也有类似的警告 –

##[warning]Directory 'd:\a\1\a' is empty. nothing will be added to build artifact 'drop'.

显然,构建不会产生任何伪影。

我是否需要将任何构建任务添加认的ASP.NET Core构建模板中?如何使用VSTS将我的Web API发布到Azure?

解决方法

作为警告消息,您的存储库似乎没有Web项目。
因此,您应该取消选择.NET Core发布任务中的“发布Web项目”选项,并在项目选项中指定.csproj。

您还可以找到“发布Web项目”选项的提示消息,如下所示:

If true,the task will try to find the web projects in the repository and run the publish command on them. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory.

相关文章

本文将从上往下,循序渐进的介绍一系列相关.NET的概念,先从...
基于 .NET 的一个全新的、好用的 PHP SDK + Runtime: Pe...
.NET 异步工作原理介绍。
引子 .NET 6 开始初步引入 PGO。PGO 即 Profile Guided Opti...
前言 2021/4/8 .NET 6 Preview 3 发布,这个版本的改进大多来...
前言 开头防杠:.NET 的基础库、语言、运行时团队从来都是相...