加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 00:20:45 所属栏目:asp.Net 来源:网络整理
导读:我使用Visual Studio 2017(Community Edition)创建了一个ASP.NET Core Web API应用程序。我可以使用Visual Studio成功发布到Azure App Service。 我现在想要使用VSTS设置CI / CD。我使用了Visual Studio中的“配置持续交付”选项,该选项在VSTS中创建了一个
我使用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:a1a' 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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读