15

我正在尝试让 TeamCity 构建一个我创建的简单 Web 项目。该项目是使用网站的 Visual Studio 2012 模板创建的。我还没有添加任何东西。

该项目将在本地机器上构建和运行良好,当我使用 Visual Studio (sln) 运行程序时它不会构建。

我不断收到以下错误...(对长时间的剪切和粘贴表示歉意)

[MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AspNet.ScriptManager.jQuery.UI.Combined". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, 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:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OAuth.Consumer". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.OpenId.RelyingParty". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DotNetOpenAuth.AspNet". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNet.Membership.OpenAuth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNet.FriendlyUrls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest.sln.teamcity" (TeamCity_Generated_Build target) (1) ->

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest.sln" (Rebuild target) (2) ->

[14:22:40][MSBuild output] "C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj" (Rebuild target) (3) ->

[14:22:40][MSBuild output] (CoreCompile target) -> 

[14:22:40][MSBuild output]   App_Start\AuthConfig.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   Account\Manage.aspx.cs(7,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   Account\OpenAuthProviders.ascx.cs(4,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   Account\Register.aspx.cs(8,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   Account\RegisterExternalLogin.aspx.cs(4,7): error CS0246: The type or namespace name 'DotNetOpenAuth' could not be found (are you missing a using directive or an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   Account\RegisterExternalLogin.aspx.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   App_Start\RouteConfig.cs(5,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output]   ViewSwitcher.ascx.cs(8,17): error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\TeamCity\buildAgent\work\efb8dd7cf59a4861\TeamCityTest\TeamCityTest\TeamCityTest.csproj]

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output]     11 Warning(s)

[14:22:40][MSBuild output]     8 Error(s)

[14:22:40][MSBuild output] 

[14:22:40][MSBuild output] Time Elapsed 00:00:00.56

这些引用似乎都是 NuGet Refs,我在 TeamCity 中错过了一步吗?我应该使用不同的跑步者吗?

4

4 回答 4

16

TeamCity 正在寻找它们的地方可能不存在这些程序集。当解决方案/依赖项被移动时,我已经看到了这一点。

您可以尝试在文本编辑器中打开 .csproj 文件并查看<HintPath>相关程序集的值。这些通常是相对路径,因此您需要确保它们与 CI 服务器上的目录结构一致。理想情况下,目录结构将在两种环境中匹配。

例子:

<ItemGroup>
    <Reference Include="ServiceStack">
        <HintPath>..\packages\ServiceStack.3.9.56\lib\net35\ServiceStack.dll</HintPath>
    </Reference>
    ...
</ItemGroup>

您可能还想在下一次构建之前检查“在构建之前清理检出目录中的所有文件”框,以确保它能够获取更改。

于 2013-08-06T19:53:30.050 回答
4

我最近有这个。

对我来说,有两件事有助于解决问题。

1)我将嵌套解决方案文件夹中的项目移动到根级别。2)我检查了 TeamCity 服务器上的工作文件夹,以查看从 SVN 中签出的内容(在我的情况下)以及正在下载/恢复哪些包。我不得不删除/添加丢失的包,其中一个包(Microsoft.OWIN.Hosting)根本没有被下载/恢复(我认为它无法在 Nuget 上找到包)所以我有要删除包,请在我的项目中明确引用 DLL,然后将 DLL 复制到同一位置的 TC 框。真的很可怕,但它得到了建设。我敢肯定有更好的方法来做到这一点 - 也许在 SVN 中使用 Externals。

希望这可以帮助。

于 2015-03-25T20:22:50.247 回答
2

我认为您只是缺少构建中的 nuget 包,因为它可能会在一个新位置。那是除非你让他们签入源代码控制?你需要告诉teamcity来获取它们。

有一个用于获取包Teamcity Nuget 安装程序文档的 Teamcity Nuget 安装构建步骤,或者您可以滚动自己的任务来执行此操作。

于 2013-08-29T08:50:16.233 回答
0

仅作记录,这可能是由于在您的解决方案中构建了依赖项......

例如,如果在结帐时文件夹已“清理”并且您的构建依赖项错误,则 dll 将不会出现在任何地方。

在 TeamCity 未能应用补丁并且项目未设置为在结帐时自行清理之后,我遇到了这个问题......当它没有被清理时,构建依赖问题并不明显。

由于错误导致文件夹被清理......因此构建依赖问题出现在前台。

于 2014-07-25T16:00:18.200 回答