2012-11-14 63 views
0

我们从CruiseControl.net运行MSBuild。
我们一个分支,当通过CC在构建服务器构建,失败,出现以下错误:MSBuild AssemblyInfo CreateItem失败

<target name="UpdateAssemblyInfo" startTime="11/13/2012 18:48:35" elapsedTime="00:00:01" elapsedSeconds="1" success="false">   
<error code="MSB4018" file="C:\Continuous Integration Projects\Project\Release\Build\Master.build" line="88" column="5" timeStamp="11/13/2012 18:48:36"><![CDATA[The "CreateItem" task failed unexpectedly.System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. at System.IO.PathHelper.GetFullPathName() 

错误的推移有更多的行...

的任务是在规定master.build:

<Target Name="UpdateAssemblyInfo">  
    <CreateItem Include="$(SourcePath)\**\Properties\AssemblyInfo.cs">  
     <Output TaskParameter="Include" ItemName="UpdateAssemblyInfoFiles"/> 
    </CreateItem>  
    <Attrib Files="@(UpdateAssemblyInfoFiles)" Normal="true" />  
    <AssemblyInfo AssemblyInfoFiles="@(UpdateAssemblyInfoFiles)" AssemblyVersion="$(CCNetLabel)" AssemblyFileVersion="$(CCNetLabel)"/> 
</Target> 

我们怎样才能找出哪个AssemblyInfo.cs导致问题?
有没有办法将诊断输出添加到master.build文件中?

感谢任何见解...

+0

你能提供master.build文件的第88行吗? –

+0

88行是行。 – Number8

回答

0

设置的MSBuild的详细级别,以diag并检查输出。假设你正在使用CCNET的<msbuild> task这应该是它:

<msbuild> 
    <!-- ... --> 
    <buildArgs>/v:diag</buildArgs> 
</msbuild> 
+0

谢谢,输出将出现在日志文件中? – Number8

+0

以获得输出到日志文件,您需要将MSBuild记录器设置为CCNET的ThoughtWorks.CruiseControl.MsBuild.dll或Rodemeyer记录器(http://confluence.public.thoughtworks.org/display/CCNETCOMM/Improved+MSBuild+集成),并通过合并任务合并创建的XML日志 –

+0

此时,我会建议从命令行运行msbuild并在屏幕上查看输出,而不是配置ccnet,特别是因为这将是一个临时更改。 –

0

例外确实状态的路径或文件名超过了长度的限制。

System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

由于AssemblyInfo.cs是长度小于260字符我们可以推断出它不喜欢的路径。

你能够检查路径部分是否为248个字符或更多?

+0

感谢您的回复。解决方案中有~60个AssemblyInfo.cs文件;我找不到任何总路径长度> 260。也许它在包含如下内容的路径上窒息:\ A.B.C \ D.E.F.G \ Properties \ AssemblyInfo.cs? – Number8

+0

在这种情况下,我认为你必须看看详细的msbuild输出。请参阅我对@主席的回答的评论 –

相关问题