简体   繁体   English

无法写入输出文件Spcified Path / FileName太长了?

[英]Cannot Write To The Output File The Spcified Path/FileName Are Too Long?

I got this error in one of my projects seemingly out of no where: 我在我的一个项目中出现了这个错误,似乎没有:

 Cannot write to the output file "obj\\Debug \\WindowsFormsApplication1.Properties.Resources.resources". 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. 

How can I fix this? 我怎样才能解决这个问题?

Use a shorter path, Win32 doesn't support longer paths than that. 使用较短的路径,Win32不支持比这更长的路径。 Shorter directory-names or less deeply nested hierarchies could help. 较短的目录名称或较少嵌套的层次结构可能会有所帮助。 The path to where you're project files are is already so long, so that when it tries to generate a file in the debug subdirectory the maximal length for paths is exceeded. 项目文件所在的路径已经很长,因此当它尝试在debug子目录中生成文件时,会超出路径的最大长度。

NTFS itself, the native NT APIs and the Win32 API using the \\\\?\\ support much longer paths. NTFS本身,本机NT API和使用\\\\?\\支持更长路径的Win32 API。 But for "normal" path Win32 is limited to 260 chars for historical reasons. 但是对于“正常”路径,由于历史原因,Win32限制为260个字符。 In particular C programs rely on the fact that a 260 char buffer can contain any path. 特别是C程序依赖于260 char缓冲区可以包含任何路径的事实。 The part of Microsoft responsible for the Win32 API is very careful not to break compatibility with older programs. 负责Win32 API的Microsoft部分非常小心,不要破坏与旧程序的兼容性。

我假设“\\ _ obj ..”目录在某个深层路径中,因此修复将移动它,使其不超过260/248长度限制。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM