Azure的自动构建失败 [英] Azure automatic build failed

查看:269
本文介绍了Azure的自动构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近创建了visualstudio.com项目,并在Azure上启用持续构建。我创建的Web API项目,并创建了一些模型和API控制器。然后我在网上部署了它,它是冷静了好一会儿。然后,我通过更新所有的Nu​​Get依赖。当地还应用我的本地机器上工作了构建罚款。然后,我签入到TFS和自动部署在踢,具有生成错误。
它说:

I have recently created project on visualstudio.com, and enabled continuous build on azure. I created web api project, and created some models and api controllers. Then I deployed it online and it was cool for a good while. Then I updated all dependencies through NuGet. Build went fine on local and also app worked on my local machine. Then I checked in to tfs, and automatic deploying kicked in, with build error. It says:

C:\\ A \\ SRC \\ HitchStopApi \\包\\ Microsoft.Bcl.Build.1.0.6 \\ TOOLS \\ Microsoft.Bcl.Build.targets(74):在EnsureBindingRedirects任务无法从装配C的装填:\\ A \\ SRC \\ HitchStopApi \\包\\ Microsoft.Bcl.Build.1.0.6 \\工具\\ Microsoft.Bcl.Build.Tasks.dll。无法加载文件或程序'file:///C:\\a\\src\\HitchStopApi\\packages\\Microsoft.Bcl.Build.1.0.6\\tools\\Microsoft.Bcl.Build.Tasks.dll'它依赖或1。该系统找不到指定的文件。确认的<&UsingTask GT;声明是正确的,该程序集及其所有依赖都可用,该任务包含实现Microsoft.Build.Framework.ITask一个公共类。

在我的本地机器构建我得到警告的测试项目

On my local machine build I get warning for Tests project

<$c$c>D:\\Programming\\Projects\\HitchStop\\HitchStopApi\\packages\\Microsoft.Bcl.Build.1.0.6\\tools\\Microsoft.Bcl.Build.targets(220,5):警告:项目必须安装的NuGet包Microsoft.Bcl

在当地我使用.NET 4.5,MVC4,实体框架5.0 ...

On local I use .NET 4.5, MVC4, Entity framework 5.0...

推荐答案

这是有点错误的,并记录在几个地方。 Bcl.Build不是建立在TFS要求的项目,所以你只需要告诉TFS不包括它,如果它不存在。要做到这一点,打开你的.csproj文件(引用Bcl.Build每个项目),并更改以下内容:

This is somewhat of a bug and is logged in several places. Bcl.Build isn't a project required to build on TFS, so you simply need to tell TFS not to include it if it doesn't exist. To do this, open up your .csproj file (for each project that references Bcl.Build) and change the following:

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets" />

添加一个条件:

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.6\tools\Microsoft.Bcl.Build.targets')" />

注意:如果您通过下列方式更新的NuGet Bcl.Build,它也将更新您的项目文件,下面就需要再次进行。创建第二个副本,这和其注释掉,如果你不想失去它每次更新/有一个参考。

Note: If you update Bcl.Build via Nuget, it will also update your project file and the following will need to be done again. Create a second copy of this and comment it out if you don't want to lose it every update/have a reference.

相关参考文献(同一个问题,不同的表现形式):

Related References (same issue, different manifestation):

<一个href=\"http://social.msdn.microsoft.com/Forums/en-US/TFService/thread/7bd2e96b-552a-4897-881c-4b3682ff835e\">http://social.msdn.microsoft.com/Forums/en-US/TFService/thread/7bd2e96b-552a-4897-881c-4b3682ff835e

<一个href=\"https://connect.microsoft.com/VisualStudio/feedback/details/788981/microsoft-bcl-build-targets-causes-project-loading-to-fail\">https://connect.microsoft.com/VisualStudio/feedback/details/788981/microsoft-bcl-build-targets-causes-project-loading-to-fail

的https://nuget.$c$cplex.com/workitem/3135

更新:微软写过一篇官方博客这一点。虽然上述并在某些情况下,其不能保证正常工作。微软和的NuGet团队正在研究解决方案一起工作,但在此期间提供3解决方法选项(更好?):

Update: Microsoft wrote an official blog on this. While the above does work in some situations, its not a guarantee. Microsoft and the NuGet team are working together on a solution, but in the meantime have provided 3 (better?) workaround options:

<一个href=\"http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx\">http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx


  1. 停止使用包恢复和办理登机手续的所有程序包文件

  2. 显式运行包建项目之前恢复

  3. 入住的.targets文件

这篇关于Azure的自动构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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