2

My DNU publish step is failing in TeamCity due to the path length eventually getting out of control:

[14:35:29][Step 1/1] Using Package dependency Microsoft.Extensions.Configuration.FileProviderExtensions 1.0.0-rc1-final
[14:35:29][Step 1/1]     Source C:\Users\TFSSERVICE\.dnx\packages\Microsoft.Extensions.Configuration.FileProviderExtensions\1.0.0-rc1-final
[14:35:29][Step 1/1]     Target D:\TeamCity\buildAgent\work\31745f64510dfced\artifacts\Company.Auth.IdentityProvider\approot\packages\Microsoft.Extensions.Configuration.FileProviderExtensions\1.0.0-rc1-final
[14:35:29][Step 1/1] Using Package dependency Microsoft.Extensions.FileSystemGlobbing 1.0.0-rc1-final
[14:35:29][Step 1/1]     Source C:\Users\TFSSERVICE\.dnx\packages\Microsoft.Extensions.FileSystemGlobbing\1.0.0-rc1-final
[14:35:29][Step 1/1]     Target D:\TeamCity\buildAgent\work\31745f64510dfced\artifacts\Company.Auth.IdentityProvider\approot\packages\Microsoft.Extensions.FileSystemGlobbing\1.0.0-rc1-final
[14:35:29][Step 1/1] 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.
[14:35:29][Step 1/1] Process exited with code 1
[14:35:29][Step 1/1] Step DNU publish (Command Line) failed

I have already updated my checkout rules agent path to root the project closer to the build agent directory.

A possible solution could be to set the publish output to be something closer to the drive root. However, the TeamCity DNU publish build step does not support changing the output directory. Additionally, I would then be responsible for managing this directory.

An ideal solution would involve the least amount of manual configuration to the build agent, as I have several of them.

Benjamin Soddy
  • 557
  • 1
  • 6
  • 22

3 Answers3

3

A possible solution is to modify the Team City build agent config to use a shorter path for the working folder. i.e. change

D:\TeamCity\buildAgent\work

To something like

D:\work

or even

D:\w

James Reed
  • 13,873
  • 51
  • 60
3

We (the ASP.NET team) use TeamCity and hit the path limit on Windows. Unfortunately, this was caused by a node.js path and we cannot control it so we had to move the work directory closer to the drive's root. Right now is in D:\ba (ba = build agent).

So, the only solution that I have for you right now is to try to get the project closer to the drive's root.

The DNU publish command appears to operate correctly on Windows 10, but not any prior Windows version, including Server 2012 R2. As of now, I can only suspect warlock black magic (converting to NT paths and back?)

dnu should work on Win 7 (with the latest SP), Win 2008 R2, Win 8, Win 2012, Win 10, and Win 2016 Server. If you hit any issues with a particular platform, open a bug on Github (aspnet)

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • I did implement a custom output directory as a temporary solution, as that was the tipping point for the path length violation. Bringing the build agent closer to the drive's root is the ideal solution, but for the setup I'm working with will be more involved as there are legacy builds that are misconfigured. – Benjamin Soddy Jan 25 '16 at 18:03
  • As far as the DNU publish acting weird on different versions of Windows is concerned, it has been elusive. Some of our Windows 10 machines have no issue publishing something that has path length violations on another machine. However, the Windows 10 machines can and will have a path length violation at some point. Likely PEBKAC. – Benjamin Soddy Jan 25 '16 at 19:23
0

You can share folder with special, short name.

Also here you can find similar question with few answers.

Community
  • 1
  • 1
Lukasz Pyrzyk
  • 418
  • 4
  • 9