问题标签 [pathtoolongexception]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
visual-studio - Visual Studio - PathTooLongException 即使路径长度小于 260 个字符
我知道创建项目时允许的最大路径长度为 260 个字符,目录为 248 个字符。但即使我的路径长度小于 200 个字符,我也会收到此错误。
我的解决方案文件位于此文件夹中 C:\Users\username\Documents\Visual Studio 2010\Projects\Health12.Domain12.WardManagement => 88 个字符 当我尝试添加名称为“Health12.Domain12.WardManagement.Service”的新类库时.Contract”这个解决方案,它给了我路径太长的异常。
C:\Users\username\Documents\Visual Studio 2010\Projects\Health12.Domain12.WardManagement\Health12.Domain12.WardManagement.Service.Contract => 138 个字符
C:\Users\username\Documents\Visual Studio 2010\Projects\Health12.Domain12.WardManagement\Health12.Domain12.WardManagement.Service.Contract\Health12.Domain12.WardManagement.Service.Contract.csproj => 195 个字符
所有可能的文件或文件夹都不超过 260 个字符的限制。
如果我将项目名称从“Health12.Domain12.WardManagement.Service.Contract ”更改为“Health12.Domain12.WardManagement.Service.Con ”,它工作正常。知道为什么 Visual Studio 不允许创建项目,即使它没有超过最大允许长度限制。
vb.net - 在 Visual Basic 中使用长路径
我使用Directory.getLastWriteTimeUtc()
方法。如果此方法的路径太长,它会抛出一个PathTooLongException
. 所以我开始使用谷歌寻找解决这个问题的方法。一些搜索结果建议我使用\\?\
前缀。使用 Windows 资源管理器,此解决方案完美运行。但它不适用于 Visual Basic。将此前缀添加到路径中,结果为 an,ArgumentException
因为 是路径中的非法字符。
所以我想问你是否有使用 Visual Basic 处理长路径的解决方案。
导致问题的代码片段如下。它用于获取文件夹的最新文件。
哦,对不起。当然,我会向您展示导致问题的代码片段。
visual-studio-2012 - 发布 Windows 窗体应用程序 - 路径太长
我正在尝试发布我的应用程序,但 bin\Debug\App.publish\ ect 路径太长。我发现您可以通过在发布配置文件中添加此 c:\shortPath\ 来更改 Web 项目中的默认路径,但我不知道如何为 Windows 窗体应用程序执行此操作,我不明白我可以编辑的任何文件。我正在使用 VS 2012
提前致谢!
c# - How to invoke PathTooLongException?
I have a small utility that keeps hitting PathTooLongException and I was instructed to output the file path for the error, with is fine... somewhat.
However I find myself not able to replicate the issue. I tried creating a file with a path that is bigger than the MAX_PATH, but my program handles it fine. I tried to increase the path size even more but Windows did not allow for this, and the kicker is that through CMD can't even go to the containing folder because I do hit PathTooLongException before that, yet my program handles it just fine, no exception thrown.
What's really weird is that although the exception is never thrown, the program simply ignores the file in question, this is the peace of code that can't seam to find it and does not throw an error.
I find myself in a weird situation, with no way to invoke the error, I am supposed to handle.
PS. I think I should mention that I can't use the deployment paths, because of various reasons.
Here is the full path, in theory:
C:\net\sync-test-1\G1244kljsdfglksdjflsdjlfkjajhalsjflkdsajkljsdflk\long_name_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItI\long_na.txt
Here is the same containing folder when I take it from windows address bar: C:\net\SYNC-T~1\G1244K~1\long_name_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItIs_YesItI
And this is the stack trace that the program sent out in deployment:
So here is the source code for the SyncContainer():
c# - 错误类型:来自 IP 地址的 System.IO.PathTooLongException:157.55.39.175 AKA Microsoft Bingbot
错误通知的详细信息如下。我的问题是如何减少 Bingbots 产生的大量异常?如果这样做的话,我会失去什么?
System.IO.PathTooLongException
IP 地址:157.55.39.175 用户:访客
错误类型:System.IO.PathTooLongException 消息:路径太长 指定的路径、文件名或两者都太长。完全限定的文件名必须少于 260 个字符,目录名必须少于 248 个字符。堆栈跟踪:System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value) at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck) at System.Security.Util.StringExpressionSet.CanonicalizePath(String path , Boolean needFullPath) at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath , Boolean copyPathList) 在 System.Security.Permissions。/ HTTP_ACCEPT_ENCODING:gzip,放气 HTTP_FROM:bingbot(at)microsoft.com
REMOTE_ADDR 157.55.39.175 REQUEST_METHOD GET
URL /ics/students/jfx/extensions/webeditors/ui/common/scripts/jfx/extensions/webeditors/ui/common/scripts/jfx/extensions/feedback/jfx/ui/common/scripts/clientconfig/htmlcontent/scripts/ ui/common/scripts/jfx/extensions/directorysearch/directorysearch.js
HTTP_FROM bingbot(at)microsoft.com
node.js - Azure Webjob System.IO.PathTooLongException
我正在尝试在我的 Azure 网站上部署一个 On Demand node.js WebJob,它使用一些节点库,但每次运行都会产生错误
取出库可以纠正错误,但是我无法运行 WebJob。我该如何解决这个问题?
azure - VSTS在线新建系统报错“指定的路径、文件名或两者都太长。”
我正在使用新的 Visual Studio Team Services Online 运行简单构建,包括在自定义 Windows Server 2012 R2 VM 上执行以下任务:
- nuget 安装程序
- npm
- 吞咽
- Visual Studio 构建
- Visual Studio 测试
- Azure Web 应用部署
- 索引来源和发布符号
- 发布构建工件
任务 #1 到 #4 运行成功,任务 #5 (vstest) 抛出以下错误:
c# - 如何通过添加 \\?\ 前缀来重命名文件信息以避免 System.IO.PathTooLongException?
我正在寻找一种避免 System.IO.PathTooLongException 的方法。我读到我可以把\\?\
前面的路放得很长。
问题是我有FileInfo
对象,我问我如何在不编写无用代码的情况下将\\?\
路径前缀添加到我的路径中。FileInfo
请注意,我有包含数千个文件要复制的文件夹,我不希望我的应用程序在他的过程中花费大量无用的时间。
谢谢。
c# - 在 Windows 服务中使用带有 .net 4.6.2 的长路径 (>260)
我有一些代码已经开始抛出异常:TooLongPathException。所以我做了一些研究,发现 .net 4.6.2 解决了这个问题。伟大的!
失败的代码是将文件夹移动和复制到不同文件夹的代码。我想使用 .net 4.6.2 框架使此代码能够使用更长的路径,因此我不需要编写一些解决方法。
我已经在机器上安装了 .net 4.6.2 框架。该机器运行 Windows server 2008 R2 SP1。我已将项目目标设为 4.6.2 框架,但仍会引发此错误。
我不确定我在这里缺少什么。
有没有人使用 .net 4.6.2 来做类似的事情,可以指出我需要做什么?
c# - 抛出异常:'System.IO.DirectoryNotFoundException' 和 System.IO.PathTooLongException
您好,我正在尝试使用 ZipInputStream 解压 zip 之类的 zip(例如,对于 Unseekable 输入流)。在SharpZipLib的帮助下。但这总是给我一个错误:
错误:
抛出异常:mscorlib.dll 中的“ System.IO.DirectoryNotFoundException ”错误:找不到路径的一部分“C:\Users\username\Documents\Visual Studio 2015\Projects\WpfApplication1\WpfApplication1\bin\Debug\ASPNETWebAPISamples-掌握\'。
我什至尝试过**ZipFile.ExtractToDirectory**
内置提取器和http://dotnetzip.codeplex.com/。他们俩也都给了Path too Long例外。
我发现了几个关于路径太长异常的问题。但没有一个对我有用。
如何解决此错误?谢谢。