Tfs构建失败。

7

我在TFS构建控制器中配置了项目,但在排队新的构建后遇到了构建失败的问题。在日志中我发现了缺少引用的错误,但我已经检查过所有文件并进行了提交。

我该如何调试和创建良好的TFS构建压缩包。

构建失败。

   "C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp.sln" (default target) (1) ->
   "C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj" (default target) (2) ->
   (ResolveAssemblyReferences target) -> 
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Optimization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth.Consumer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId.RelyingParty, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "WebGrease". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Antlr3.Runtime". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]


   "C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp.sln" (default target) (1) ->
   "C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj" (default target) (2) ->
   (CoreCompile target) -> 
     App_Start\BundleConfig.cs(2,18): error CS0234: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Controllers\AccountController.cs(8,7): error CS0246: The type or namespace name 'DotNetOpenAuth' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Filters\InitializeSimpleMembershipAttribute.cs(3,26): error CS0234: The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Global.asax.cs(7,18): error CS0234: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(4,45): error CS0234: The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(12,33): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     App_Start\BundleConfig.cs(9,44): error CS0246: The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(19,16): error CS0246: The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(26,10): error CS0246: The type or namespace name 'DatabaseGeneratedAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(26,10): error CS0246: The type or namespace name 'DatabaseGeneratedAttributeAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(22,6): error CS0246: The type or namespace name 'Table' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]
     Models\AccountModels.cs(22,6): error CS0246: The type or namespace name 'TableAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\SourceCode\MvcApp\Sources\MainLine\Mvc App\MvcApp\MvcApp\MvcApp.csproj]

11 Warning(s)
12 Error(s)

已经流逝的时间 00:00:06.40

3个回答

3
你需要将所有这些dll放到你的构建机器上。简单的方法是使用NuGet来管理你的软件包,并配置它以下载缺失的dll。或者你也可以手动添加它们到构建机器上。

2

1
我知道这是一个老问题,但以下是我的解决方法。
我按照Daniel Miller的指示进行操作: http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages 然后我需要使用在此链接中提到的简单构建文件: http://docs.nuget.org/docs/reference/package-restore-with-team-build 它只需在之前触发包恢复即可。
我所做的改变仅限于构建文件中我的解决方案文件路径和nuget.exe的更改,因为我的不同。
然后我配置TFS使用build.proj文件而不是解决方案。

谢谢,我一直在尝试直接引用解决方案,但是它没有起作用。创建一个单独的TFSBuild.proj文件解决了问题! - Narayana
@Narayana 没问题,我很高兴它对你有用。我已经将它添加到其他问题中,但人们都对它进行了负评。但对我来说效果很好。 :) - hutchonoid

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接