简体   繁体   English

该文件解析为太长的路径。 最大长度为260个字符

[英]The file resolves to a path that is too long. The maximum length is 260 characters

I am running a C# .NET WPF application on a Fujitsu tablet running Windows 7, accessing a SQL Server CE 3.5 database installed in the user's AppData folder. 我正在运行Windows 7的Fujitsu平板电脑上运行C#.NET WPF应用程序,访问用户的AppData文件夹中安装的SQL Server CE 3.5数据库。 This application works correctly on other tablets of the same type and also on normal laptops or desktop PCs. 此应用程序可以在其他相同类型的平板电脑上正常运行,也可以在普通笔记本电脑或台式机上正常运行。

When the application runs on one particular tablet, I get the error: 当应用程序在一台特定的平板电脑上运行时,出现错误:

The file resolves to a path that is too long. The maximum length is 260 characters 
[File name = c:\Users\tester\AppData\Roaming\Fourmative\AppDatabase\MyDatabase#1.sdf]

Now, I have read up about the limitations on windows path names and the maximum length being 260 characters. 现在,我已经阅读了有关Windows路径名的限制,最大长度为260个字符。 However, as you can see, the length of this path is only 72 characters. 但是,如您所见,该路径的长度只有72个字符。

Also, as the Application is installed in the user's AppData folder as part of the installer, I cannot really control, on any one user machine, where this path will point to exactly. 另外,由于该应用程序作为安装程序的一部分安装在用户的AppData文件夹中,因此我无法在任何一台用户计算机上真正控制此路径确切指向的位置。

I assume that this must mean that the ACTUAL path is actually mapped somehow from the path shown? 我认为这必须意味着ACTUAL路径实际上是从所示路径以某种方式映射的? So, my question is, how can I find the full actual path (the one that must be 260 characters) from the command line so that I can determine how to really fix this issue. 因此,我的问题是,如何从命令行中找到完整的实际路径(必须为260个字符),以便可以确定如何真正解决此问题。

Windows path is unlimited, but one needs to use different syntax. Windows路径不受限制,但是需要使用不同的语法。

from http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx : 来自http://msdn.microsoft.com/zh-cn/library/windows/desktop/aa365247(v=vs.85).aspx

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. Windows API具有许多功能,它们也具有Unicode版本,以允许使用扩展长度的路径,最大总路径长度为32,767个字符。 This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). 这种类型的路径由用反斜杠分隔的组件组成,每个反斜杠都取决于GetVolumeInformation函数的lpMaximumComponentLength参数中返回的值(该值通常为255个字符)。 To specify an extended-length path, use the "\\?\\" prefix. 要指定扩展长度的路径,请使用“ \\?\\”前缀。 For example, "\\?\\D:\\very long path". 例如,“ \\?\\ D:\\ very long path”。

I'm not sure that "MyDatabase#1.sdf" is a valid file name. 我不确定“ MyDatabase#1.sdf”是否是有效的文件名。 I doubt that # is a valid character, it might be the cause of the problem, somehow... 我怀疑#是一个有效的字符,它可能是导致问题的原因,无论如何...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 指定的令牌太长。 最大长度为128个字符 - The token specified is too long. The maximum length is 128 characters 以…开头的标识符太长。 最大长度为128 - The identifier that starts with … is too long. Maximum length is 128 获取超过 260 个字符的过长文件路径的安全信息:C# - Get Security Information of a too long file path above 260 characters: C# Windows 7路径太长,无法使用.Net Framework 4.6.2创建260个字符以上的文件 - Windows 7 Path too long to create file above 260 Characters with .Net Framework 4.6.2 Windows路径的长度超过260个字符 - Windows path with a length of more than 260 characters 如何获取路径超过 260 个字符的文件的长度? - How do I get the length of a file with a path longer than 260 characters? 指定的路径,文件名或两者都太长。 C#Azure聊天机器人错误 - The specified path, file name, or both are too long. C# Azure Chat bot error Selenium C# drive.PageSource - '太长,或指定路径的组件太长。 - Selenium C# drive.PageSource - 'is too long, or a component of the specified path is too long.' 无法复制文件指定的文件名太长。 当发布机器人到天蓝色时 - Unable to copy file specified file name is too long. When publishing bot to azure 错误:文件路径太长 - Error: File Path is Too Long
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM