【问题标题】:Visual Studio 2008 References too long?Visual Studio 2008 参考资料太长?
【发布时间】:2010-01-13 05:20:33
【问题描述】:

我最近重新组织了我们的源代码控制,发现我们的一个解决方案不再构建。我们得到的唯一错误是:

错误 65 未知的构建错误,'The 指定的路径、文件名或两者都是 太长。完全限定文件 名称必须少于 260 个字符, 并且目录名必须小于 超过 248 个字符。'

我在 Visual Studio 中浏览了每个引用,每个引用的最长完整路径(路径和文件名)为 161 个字符。

我的解决方案文件夹结构如下:

C:\projects_svn\ABC\branches\01.02.03\ABC\ABC SUITE\ABC.DEF.GHIJKLM.NOP\

任何帮助将不胜感激,考虑到项目的大小,我不觉得这个文件夹结构太长,并且组织得更好。

以下是一些可能会有所帮助的技术细节(如果您需要更多信息,请告诉我): 在 Windows XP 或 Windows 7 上运行的 Visual Studio 2008 SP 2。使用 Subversion 作为 SCM。用 C#/WPF 编码。

谢谢

【问题讨论】:

  • 那个文件夹里有什么?我没有看到任何.cpp
  • 该文件夹中有一个 .sln 文件和我的项目文件(.cs、.wpf 等)

标签: visual-studio visual-studio-2008 reference


【解决方案1】:

我认为这里可能发生的情况是,您的一个项目正在使用一个相对提示路径,该路径在树上很远,然后又回到目录结构。例如

c:\foo\bar\baz\..\..\..\some\other\dir\foo.dll

即使实际文件的路径小于 256,相对 goop 也会使其更长。

找到这些的最佳方法是在所有 .csproj / .vbproj 文件中搜索字符串 ..\..\。看看这是否会产生任何结果。

【讨论】:

  • 感谢 Jared,可能就是这样。不幸的是,我看不出是什么原因造成的。
  • 太棒了,感谢您的帮助。您的建议使我可以将范围缩小到一对,然后我发现了哪些参考文献引起了问题。
【解决方案2】:

您还需要考虑 SVN 的“背景”文件。

虽然我可能有一个像这样的短文件名: c:\myfolder1\myfolder2\MyFile.txt

可能在某处潜伏着更长的文件名版本,如下所示: c:\myfolder1\myfolder2.svn\text-base\MyFile.txt.svn-base

那个背景文件是得到“方式太长”错误的那个。

这是我使用 SVN 源代码控制通过 CCNET(调用 MSBUILD 文件)得到的。 删除特定名称以保护无辜者。 (还有我的工作!)

请注意,这种“名称按摩”会导致路径更短,可能不会产生错误。又名,不要计算我按摩示例中的字符数。 但错误消息是我得到的。

    Removing directory "C:\CCNETEnvironment\MyFolder2\MyProject\working\checkout".
    C:\src\MyFolder1\MyProject\My_MSBuild.xml(173,5): error MSB3231: Unable to remove directory "prop-base". 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.
    C:\src\MyFolder1\MyProject\My_MSBuild.xml(173,5): error MSB3231: Unable to remove directory "text-base". 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.
    C:\src\MyFolder1\MyProject\My_MSBuild.xml(173,5): error MSB3231: Unable to remove directory "prop-base". 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.
    C:\src\MyFolder1\MyProject\My_MSBuild.xml(173,5): error MSB3231: Unable to remove directory "text-base". 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.
    C:\src\MyFolder1\MyProject\My_MSBuild.xml(173,5): error MSB3231: Unable to remove directory "C:\CCNETEnvironment\MyFolder2\MyProject\working\checkout". Could not find a part of the path 'MyFile.txt.svn-base'.
Done building target "Clean" in project "My_MSBuild.xml" -- FAILED.

【讨论】:

    猜你喜欢
    • 2010-12-22
    • 1970-01-01
    • 1970-01-01
    • 2010-12-09
    • 1970-01-01
    • 2011-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多