TeamCity生成项目编译错误



我正试图让TeamCity构建一个我创建的简单web项目。该项目是使用网站的Visual Studio 2012模板创建的。我还没有添加任何内容。

该项目将在本地计算机上生成并运行良好,当我使用Visual Studio(sln)运行程序时不会生成。

我不断收到以下错误。。。(抱歉剪切粘贴时间过长)

[MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   C:windowsMicrosoft.NETFrameworkv4.0.30319Microsoft.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output] 
[14:22:40][MSBuild output] 
[14:22:40][MSBuild output] "C:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTest.sln.teamcity" (TeamCity_Generated_Build target) (1) ->
[14:22:40][MSBuild output] "C:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTest.sln" (Rebuild target) (2) ->
[14:22:40][MSBuild output] "C:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj" (Rebuild target) (3) ->
[14:22:40][MSBuild output] (CoreCompile target) -> 
[14:22:40][MSBuild output]   App_StartAuthConfig.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   AccountManage.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   AccountOpenAuthProviders.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   AccountRegister.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   AccountRegisterExternalLogin.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   AccountRegisterExternalLogin.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.csproj]
[14:22:40][MSBuild output]   App_StartRouteConfig.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.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:TeamCitybuildAgentworkefb8dd7cf59a4861TeamCityTestTeamCityTestTeamCityTest.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错过了一步?我应该使用不同的Runner吗?

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

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

示例:

<ItemGroup>
    <Reference Include="ServiceStack">
        <HintPath>..packagesServiceStack.3.9.56libnet35ServiceStack.dll</HintPath>
    </Reference>
    ...
</ItemGroup>

您可能还想在下一次生成之前选中"在生成之前清除签出目录中的所有文件"框,以确保它能接受更改。

我最近遇到过这种情况。

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

1) 我将嵌套解决方案文件夹中的项目移到了根级别。2) 我检查了TeamCity服务器上的工作文件夹,查看从SVN中签出了什么(在我的情况下),以及下载/恢复了哪些包。我不得不删除/添加丢失的程序包,其中一个程序包(Microsoft.OWIN.Hosting)根本没有下载/还原(我认为它在Nuget上找不到该程序包),所以我不得不删除该程序包,在我的项目中明确引用DLL,并将DLL复制到同一位置的TC框中。真的很可怕,但它建起来了。我相信有更好的方法可以做到这一点——也许在SVN中使用Externals。

希望这能有所帮助。

我认为您只是在构建中丢失了nuget包,因为它可能会在一个新的位置。也就是说,除非你将他们签入源代码管理?你需要告诉teamcity拿到他们。

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

请注意,这可能是由于在解决方案中构建依赖关系。。。

例如,如果签出时文件夹被"清理",并且您的构建依赖项错误,那么dll将不在任何位置。

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

由于出现错误,导致文件夹被清理。。。因此,构建依赖性问题成为了人们关注的焦点。

最新更新