首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >构建Asp.Net核心项目时的System.IO.PathTooLongException

构建Asp.Net核心项目时的System.IO.PathTooLongException
EN

Stack Overflow用户
提问于 2017-01-11 03:32:49
回答 1查看 706关注 0票数 0

当我使用Visual Studio2016更新3 Asp.Net核心构建项目时,我收到此错误,构建被终止:

严重性代码说明项目文件行抑制状态错误MSB4018 "FindConfigFiles“任务意外失败。System.IO.PathTooLongException:指定的路径、文件名或两者都太长。完全限定文件名必须少于260个字符,目录名必须少于248个字符。在System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 ( String path,Boolean fullCheck,Int32 maxPathLength,Boolean expandShortPaths) at System.IO.Path.GetDirectoryName(String path) at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler,Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String resultHandler,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String projectPath,String2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String,String,TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String,String 2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String,Func 2 filter) at,String,TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String,String 2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String projectPath,Func2 filter) at TypeScript.Tasks.FileHelpers.RecursiveGatherFiles(String directoryPath, String projectPath, Func2 filter) at Func directoryPath,String,Func`2 filter) at,字符串(x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets ) at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at 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中的TypeScript.Tasks.FindConfigFiles.Execute()

我不使用任何工具,只使用Gulp。请告诉我如何解决这个问题。

EN

Stack Overflow用户

回答已采纳

发布于 2017-01-11 03:40:55

这看起来像是一个简单的错误,是由于路径(可能在依赖项中)对于Windows太长而导致的。您可以通过使用代码缩短文件夹的路径来解决此问题。

例如,尝试移动项目文件夹

从D:\weblFront\frontWeb\src\frontWeb\frontWeb\

至D:\Code\frontWeb\

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41576890

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档