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

soo*_*ise 5 c# filenames

我在我的一个项目中出现了这个错误,似乎没有:

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.
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

Cod*_*aos 6

使用较短的路径,Win32不支持比这更长的路径.较短的目录名称或较少嵌套的层次结构可能会有所帮助.项目文件所在的路径已经很长,因此当它尝试在debug子目录中生成文件时,会超出路径的最大长度.

NTFS本身,本机NT API和Win32 API使用\\?\支持更长的路径.但是对于"正常"路径,由于历史原因,Win32限制为260个字符.特别是C程序依赖于260 char缓冲区可以包含任何路径的事实.负责Win32 API的Microsoft部分非常小心,不要破坏与旧程序的兼容性.