我们从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文件中吗?
谢谢你的见解。
发布于 2012-11-15 15:53:28
将MSBuild的详细级别设置为diag并检查输出。假设您使用的是CCNET的 task,应该是这样的:
<msbuild>
<!-- ... -->
<buildArgs>/v:diag</buildArgs>
</msbuild>发布于 2012-11-16 15:28:46
异常声明路径或文件名超出了长度约束。
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字符还是更多?
https://stackoverflow.com/questions/13383012
复制相似问题