views:

277

answers:

2

I have recently re-organised our source control and found one of our solutions no longer builds. The only error that we get is:

Error 65 Unknown build error, '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.'

I went through each reference in visual studio and the longest complete path (path AND filename) of each reference was 161 characters.

My solution folder structure is thus:

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

Any help would be greatly appreciated, I do not feel this folder structure is too long, given the project size, and organises things much better.

Here are some technical details which may help (if you need more let me know): Visual Studio 2008 SP 2 running on Windows XP or Windows 7. Using Subversion as SCM. Coding in C#/WPF.

Thanks

+3  A: 

I think what's likely happening here is that one of your projects is using a relative hint path that is going very far back up the tree and then back down the directory structure. For example

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

Even though the path to the actual file is less than 256 the relative goop makes it much longer.

The best way to find these is to search all of your .csproj / .vbproj files for the string ..\..\. See if that turns up any results.

JaredPar
Thanks Jared, that is probably the case. Unfortunately I can't see which might be causing the issue.
Russell
Awesome, thanks for your help. Your suggestion allowed me to narrow it down to a couple and I found out which references were causing issues.
Russell
A: 

You also need to consider the "backdrop" files for SVN.

While I might have a short file name like this: c:\myfolder1\myfolder2\MyFile.txt

There is probably lurking somewhere a longer file name version like this: c:\myfolder1\myfolder2.svn\text-base\MyFile.txt.svn-base

And that backdrop file is the one that gets the "way too long" error.

Here is what I get via CCNET (calling a MSBUILD file) using SVN source control. Specific names removed to protect the innocent. (And my job!)

Please note that this "name massaging" results in shorter paths that probably would not generate the errors. Aka, don't count the number of characters in my massaged examples. But the error messages are what I was getting.

    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.
granadaCoder