网页API项目构建失败,Visual Studio团队服务(TFS是在线) [英] Web Api Project Fails to build with Visual Studio Team Services (was TFS Online)

查看:787
本文介绍了网页API项目构建失败,Visual Studio团队服务(TFS是在线)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个解决方案和Visual Studio Team Services是设置做持续构建内部的项目。

这包括在Web API项目的测试项目生成细,甚至包括从Web API项目的文物,但是当我看从文物投递文件夹查看它没有为网站的子文件夹。

这是与骨股设置一个新的默认的Visual Studio生成定义完成。 (没有打转转工程量其一)

(我把一个屏幕截图,但真的只是创建一个新的构建定义为选择Visual Studio和持续集成,然后点击确定,那就是这到底是什么。)

有关构建步骤的日志文件没有显示,它甚至试图建立网络API项目的csproj,只是跳过权的测试项目。 (和日志中没有任何错误)

要配置管理器为配置(和所有配置)和有问题的项目设置来构建。

据妥善建立在与该项目就好了该配置。
它出版从Visual Studio与该项目就好了。

任何想法,为什么它不会生成项目?


解决方案

根据您提供的信息,您正在使用Visual Studio的CI默认生成定义没有任何其他设置。这个定义并不生成Web应用程序发布文件。

试着在Visual Studio中构建步骤,然后排队一个新的版本中加入以下的MSBuild参数:

  / P:DeployOnBuild =真/p:outdir=$(build.artifactstagingdirectory)

更新:
由于要部署由发布管理Azure中部署的网站,你可以上传部署包下降。要做到这一点,改变的MSBuild参数给以下内容:

  / P:DeployOnBuild = TRUE / ​​P:WebPublishMethod =封装/ P:PackageAsSingleFile = TRUE / ​​P:PackageLocation =$(build.artifactstagingdirectory)\\\\

然后你可以去释放Managament,在Azure的Web应用程序部署的步骤,将Web部署包为$(System.DefaultWorkingDirectory)\\ **​​ \\ ProjectName.zip。

I have a project inside a solution and Visual Studio Team Services is setup to do continuous build.

The test project that includes the Web API project builds fine and even includes the artifacts from the web api project, but when I look at the drop folder from artifacts view it doesn't have a sub folder for the website.

This is done with a new default Visual Studio Build definition with bone stock settings. (no amount of playing around works either)

(I'd put in a screen shot but literally just create a new build definition as choose visual studio and continuous integration and click ok, and that's exactly what this is.)

The log file for the build step doesn't show that it even tries to build the csproj for the web api project and just skips right to the Tests project. (and no errors in the log either)

Going to configuration manager for that configuration (and all configurations) and the project in question is set to build.

It builds properly in that configuration with that project just fine. It publishes from Visual Studio with that project just fine.

Any ideas why it won't build the project?

解决方案

According to the information you provided, you are using a default build definition for Visual Studio CI without any other settings. This definition does not generate the web app publish files.

Try adding following MSBuild Arguments in "Visual Studio Build" step and then queue a new build:

/p:DeployOnBuild=true /p:outdir=$(build.artifactstagingdirectory)

Update: Since you want to deploy the website by Azure Deploy from Release Management, you can just upload the deployment packages to drop. To do this, change the MSBuild Arguments to following:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"

And then you can go to Release Managament, in the "Azure Web App Deployment" step, set "Web Deploy Package" to "$(System.DefaultWorkingDirectory)\**\ProjectName.zip".

这篇关于网页API项目构建失败,Visual Studio团队服务(TFS是在线)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆