Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs to be migrated to newer .NET Framework version to support Long File Names #61

Open
GeyserLaPunk opened this issue Apr 14, 2021 · 4 comments

Comments

@GeyserLaPunk
Copy link

Needs to be migrated to newer .NET Framework version to support Long File Names.

Throws following error if path or name is too long:

ERROR: 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.
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.
   at System.IO.Path.NewNormalizePathLimitedChecks(String path, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at Hpdi.Vss2Git.GitExporter.WriteStream(Stream inputStream, String path)
   at Hpdi.Vss2Git.GitExporter.WriteRevisionTo(String physical, Int32 version, String destPath)
   at Hpdi.Vss2Git.GitExporter.ReplayRevision(VssPathMapper pathMapper, Revision revision, GitWrapper git, LinkedList`1 labels)
   at Hpdi.Vss2Git.GitExporter.<>c__DisplayClass24_1.<ReplayChangeset>b__0()
   at Hpdi.Vss2Git.GitExporter.AbortRetryIgnore(ThreadStart work, MessageBoxButtons buttons)

if using runtime settings like this:

<runtime>   
		<AppContextSwitchOverrides value="Switch.System.IO.BlockLongPaths=false;Switch.System.IO.UseLegacyPathHandling=false" />   
	</runtime>

then the error become:

ERROR: Could not find a part of the path 'D:\Long\File\Path|name.sql'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Hpdi.Vss2Git.GitExporter.WriteStream(Stream inputStream, String path)
   at Hpdi.Vss2Git.GitExporter.WriteRevisionTo(String physical, Int32 version, String destPath)
   at Hpdi.Vss2Git.GitExporter.ReplayRevision(VssPathMapper pathMapper, Revision revision, GitWrapper git, LinkedList`1 labels)
   at Hpdi.Vss2Git.GitExporter.<>c__DisplayClass24_1.<ReplayChangeset>b__0()
   at Hpdi.Vss2Git.GitExporter.AbortRetryIgnore(ThreadStart work, MessageBoxButtons buttons)
@shirgoldbird
Copy link

@GeyserLaPunk I'm running into this same issue. Have you attempted to upgrade it yourself?

@GeyserLaPunk
Copy link
Author

@GeyserLaPunk I'm running into this same issue. Have you attempted to upgrade it yourself?

I did, but unsuccessful, still hit the limit.
The only way I was able to convert is to limit length of the output directory to the bare minimum.

@shirgoldbird
Copy link

@GeyserLaPunk I was able to get this working by editing a registry key on Windows 10 v1067. I also had to create an application manifest file. I used these instructions:

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later

Hope this helps! I will push changes to my fork in the next few days as well.

@erezwanderman
Copy link

Maybe the program should analyze the longest file name and directory name before starting and check if they are supported. So you won't get stuck with an error after many hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants