PathTooLongException [英] PathTooLongException

查看:127
本文介绍了PathTooLongException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的VSTS版本中,我经常在尝试清除以前的部署时遇到PathTooLongException。长路径位于node_modules目录中。我有一个解决方法,在我的发布结束时添加一个清理步骤,它总是运行
并删除工件目录。但是我不认为我应该这样做,我想知道为什么清理步骤处理目录名称很好(如果我进入我的构建/发布代理并手动删除目录,它也可以正常工作)。


这是堆栈跟踪:





  1.  2016-07-28T03:50:59.3246931Z ## [section]错误:System.IO.PathTooLongException:指定的路径,文件名或两者都太长。完全限定的文件名必须少于260个字符,目录名必须少于248个字符。

    解决方案

    Hello sir_kaiza,


    我认为Node-模块目录可能包含深层嵌套目录,因此每次都无法删除特定目录。 Clean会自动完成。


    问候,


    In my  VSTS release I frequently get a PathTooLongException when it tries to clean up from the previous deployment. The long paths are in the node_modules directory. I've got a workaround to add a cleanup step at the end of my release which always runs and just deletes the artifact directory. However I don't think I should have to do that and I'm wondering why the cleanup step handles the directory names fine (it also works fine if I go into my build/release agent and manually delete the directory).

    Here is the stack trace:

    1. 2016-07-28T03:50:59.3246931Z ##[section]Error: System.IO.PathTooLongException: 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.

      解决方案

      Hello sir_kaiza,

      I think Node- module directories may contain deep nested directories, so that every time it’s not possible to delete particular directory. Clean will do that automatically.

      Regards,


      这篇关于PathTooLongException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

      查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆