I had a little shocker yesterday while trying to publish a project. Visual Studio informed me that I had a full file path that was just too long to handle. It also told me that Windows uses a magic number of 260 characters to gauge these issues?
The red part is the temporary publish directory. I have almost no control over that. I found a solution to redirecting where the temporary directory is, but it involved transformations and I wasn’t sure how to implement the solution. Read Here.
The blue part is a service reference is that I am using and the whole lot of that is auto generated. I have, again, almost no control over that. Can I shorten the names? Yes? However it would make the meaning very unclear and I shouldn’t have to make my source code unclear so that I can be within a limitation that Microsoft set 10 years ago and they never fixed.
Where do I complain about this too?
This is the Declined Request
https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation
This is the New Request
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4954037-fix-260-character-file-name-length-limitation
Playing Devil’s Advocate
I totally understand why Microsoft isn’t tending to this problem, the quazi-bullshit answer provided says it all: We are too busy and do not care enough about your issue, as the number of people experiencing this issue on a daily is very small in comparison to literally the rest of the world. So yeah I totally understand that – but wow… Hard coded limitations. This is a very good example of WHY YOU DON’T USE MAGIC NUMBERS!!!!!!
Conclusion and Reasoning
This is why I always warn people NOT TO NEST THEIR PROJECTS TOO DEEPLY. When you are linked up to source control – make absolutely sure that you use a shallow structure. DO NOT put your root folder in your “My Documents” folder, do not use the default path that is provided by Visual Studio. Just use a very simple structure such as:
Drive:DevTFSServerName…. this is your root!
Example:
C:DevTfsServer.AD.Local
Thank you for info. Long Path Tool is good program for such issues
No problem. I keep hearing that and I have been meaning to check it out. Just at the time when I was trying to publish my web application I had never seen this error before so it took me for a ride and I thought there was a work around.
I will look up the Long Path Tool, but in a few words how would that help me during a publish?