开发者

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

I got this error in one of my projects seemingl开发者_JS百科y 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. 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.

NTFS itself, the native NT APIs and the Win32 API using the \\?\ support much longer paths. But for "normal" path Win32 is limited to 260 chars for historical reasons. In particular C programs rely on the fact that a 260 char buffer can contain any path. The part of Microsoft responsible for the Win32 API is very careful not to break compatibility with older programs.


I assume the "\obj.." directory is in some deep path, so the fix would be to move it so it doesn't exceed the 260/248 length limit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜