【发布时间】:2017-05-25 10:02:27
【问题描述】:
当我使用 Visual Studio 2016 update 3 Asp.Net Core 构建项目时,我收到此错误并终止构建:
严重性代码描述项目文件行抑制状态
错误 MSB4018 “FindConfigFiles”任务意外失败。
System.IO.PathTooLongException:指定的路径、文件名或两者都太长。完全限定文件名必须少于 260 个字符,目录名必须少于 248 个字符。
在 System.IO.Path.NormalizePath(字符串路径,布尔 fullCheck,Int32 maxPathLength,布尔 expandShortPaths)
在 System.IO.Path.GetDirectoryName(字符串路径)
在 System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost)
在 System.IO.Directory.EnumerateFiles(字符串路径)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func2 filter)
at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(字符串目录路径,字符串项目路径,Func`2 过滤器)
在 TypeScript.Tasks.FileHelpers.RecursiveGatherConfigFiles(字符串目录路径,字符串项目路径)
在 TypeScript.Tasks.FindConfigFiles.FindConfigFilesOnDisk()
在 TypeScript.Tasks.FindConfigFiles.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() D:\weblFront\frontWeb\src\frontWeb\frontWeb.xproj C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft .TypeScript.targets 156
我不使用任何工具等。只有 Gulp。请问如何解决这个问题。
【问题讨论】:
-
您使用的是哪个 npm 版本? (在控制台中执行 npm -v)
-
npm 版本为:4.1.1
标签: node.js typescript npm asp.net-core visual-studio-2005