We have a number of projects, and each lives deep in a folder structure. When one set of projects needs to reference a project in a different folder, the reference can fail because the relative path to is in VS is too long.
For example, project 1 will be in:
C:\folderA\folder1\folder2...\folderN\myProject1.csproj
It references another project:
C:\folderB\folder1\folder2...\folderN\myProject2.csproj
The HintPath to the reference is stored as a relative path, as in ............\folderB\folder1\folder2...\folderN\myProject2.csproj
When VS loads the solution, it can't resolve the reference because the absolute path it builds includes numerous ../'s such that the path exceeds 256 characters. And the build fails.
We fix it by editing the csproj and putting in an absolute path, which is just silly.
What is the best solution for this?
The max recommended project name length is 64 char. Team foundation server do not allow more than 64 char See the following link http://www.grabthecode.com/visual-studio/length-of-visual-studio-project-name
Short answer - don't do that and it will not hurt. Consider less deep hierarchies and make related projects to live close.
MSBuild is managed application and CLR have restriction on path/file name length of about 256 characters...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With