Questions tagged [pathtoolongexception]

PathTooLongException is a C# exception that is thrown when a path or file name is longer than the system-defined maximum length.

36 questions
12
votes
5 answers

DirectoryInfo, FileInfo and very long path

I try to work with DirectoryInfo, FileInfo with very long path. I try use \\?\c:\long path (i got illegal caracter with fileInfo and DirectoryInfo) I try use file://c:/long path (i got uri not supported) Can i use ~ in a path or something else. I…
Cédric Boivin
  • 10,854
  • 13
  • 57
  • 98
8
votes
4 answers

resolve xamarin android "path too long" without relocation

I have recently started getting the error ResolveLibraryProjectImports: PathTooLongException on my xamarin android project within xamarin.forms. When I look up online all solutions say to relocate the project. Is there any way to change the project…
Neville Nazerane
  • 6,622
  • 3
  • 46
  • 79
7
votes
1 answer

Silverlight IsolatedStorage PathTooLongException

I'm getting this exception on 50% of WinXP SP3 machines. I know about 260 characters path length limit, but what can be done? I'm already naming files to only 2 characters, without any subdirectories, but path to IsolatedStorage is already above 260…
Alex Burtsev
  • 12,418
  • 8
  • 60
  • 87
6
votes
4 answers

Visual Studio - PathTooLongException even when the path length is less than 260 characters

I know that max path length allowed while creating a project is 260 characters and 248 characters for directory. But I'm getting this error even when my my path length is less than 200 characters. My solution file resides in this folder…
Andy
  • 321
  • 1
  • 3
  • 11
5
votes
3 answers

How to overcome PathTooLongException?

So I am writing a program that will scan for duplicate files on a computer as the programs that I've seen are really slow, and/or memory hogs, but I was running into a PathTooLongException when I tried to the whole drive. After reading…
soandos
  • 4,978
  • 13
  • 62
  • 96
5
votes
1 answer

Why can't .NET detect directories with long file paths?

I can't enumerate the contained files in a directory if the full path to those files exceeds 260 chars. The following code shows the problem: void TestLongPath(DirectoryInfo testDirectory) { if (testDirectory.Exists) { try { …
Ebonair
  • 221
  • 1
  • 11
5
votes
1 answer

C#: Long Path with UseLegacyPathHandling and BlockLongPaths not working

I'm using C# with .NET v4.7.2 and Windows 10 and I have some files with long path (>260 characters in the paths) to copy. I know there is a solution to prefix the path by \\?\ This prefix is working, but I do not want to prefix everytime for any…
jaz
  • 228
  • 2
  • 14
5
votes
4 answers

PathTooLongException when I install Visual Studio extension

I am having trouble installing Visual Studion 2010 extension: Install Error : System.IO.PathTooLongException: C:\Users\felix.DOMAIN\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Vendor\Vendor 2011 Developer…
Felix
  • 9,248
  • 10
  • 57
  • 89
5
votes
1 answer

How to shorten a path in c# and keep it valid

I work in a place where directories have such a looong name and are in such a looong tree. And I'm having problems with too long path names for folders in an external applicatoin (I can't change this external application, but I can give it…
Daniel Möller
  • 84,878
  • 18
  • 192
  • 214
5
votes
3 answers

PathTooLongException C# 4.5

I having trouble of copying some folder 260+ chars (for example: F:\NNNNNNNNNNNNNNNN\NNNNNNNNNNN\ROOT\$RECYCLE.BIN\S-1-5-21-3299053755-4209892151-505108915-1000\$RMSL3U8\NNNNNNNNN NNNNNNNN\NNNNNNNNNNN\NNNNNNNNNN\NNNNNNNNNN\publish\Application…
4
votes
5 answers

C# I/O library that supports long paths (to solve PathTooLongException)

My open source software synchronizes a remote folder to the local desktop. The remote folder can be on Alfresco, where path length has no limit (/root/very/very/very/long/name.txt). When developing the application I used System.IO.File.OpenWrite and…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
3
votes
1 answer

Retrieve path information from PathTooLongException

I am using DirectoryInfo and FileInfo in .Net 4.0 to enumerate files in a directory tree and I am hitting PathTooLongException. Simplified version is below public static class Test { public static void Search(DirectoryInfo base) { …
Andyrooger
  • 6,748
  • 1
  • 43
  • 44
3
votes
0 answers

Long path support in Net.Framework 4.7.2 and Windows 10

To solve the problem of limiting paths to 255 characters, the following was done: Windows 10 2004 includes "Enable Win32 long paths" in the "Local Computer Policy". In the registry branch: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \…
2
votes
1 answer

Powershell 5.1 - the filename or extension is too long. How to split 1 command with dynamic arguments into more sequential calls?

Problem: In powershell 5.1 I run a command, myProgram, and pass to its -itemsToProcess flag a comma separated string list (of dynamic length), $commaSeparatedList, as arguments. There are often too many characters, sometimes 125000 characters, or…
2
votes
0 answers

ASP.NET Core - Windows 10 Pro - Publish to IIS - The specified path, file name, or both are too long

I'm trying to publish an ASP.NET Core web application with Angular frontend to my webhosting account. The project uses SSR, which causes generated files to end up at a path longer than 260 characters. Usually I put the solution folder directly…
1
2 3