0

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

<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 文件?

感谢您的任何见解...

4

2 回答 2

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字符或更多?

于 2012-11-16T07:28:45.617 回答
0

将 MSBuild 的详细级别设置为diag并检查输出。假设您正在使用 CCNET 的<msbuild>任务,这应该是:

<msbuild>
  <!-- ... -->
  <buildArgs>/v:diag</buildArgs>
</msbuild>
于 2012-11-15T07:53:27.693 回答