Can't write to the output file Spcified Path / FileName for too long?

I got this error in one of my projects, it would seem, from which:

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?

+4
source share
2 answers

Use a shorter path; Win32 does not support longer paths than this. Shorter directory names or less deeply nested hierarchies can help. The path to where you are the project files is already so long, so when it tries to generate the file in the debug subdirectory, the maximum path length is exceeded.

NTFS, the native NT APIs and the Win32 APIs with \\?\ Support much longer paths. But for the โ€œnormalโ€ path, Win32 is limited to 260 characters for historical reasons. In particular, C programs rely on the fact that the 260 char buffer can contain any path. The part of Microsoft that is responsible for the Win32 API is very careful not to compromise compatibility with older programs.

+6
source

I assume the directory "\ obj .." is in some deep path, so the fix would have to move it so that it does not exceed the 260/248 length limit.

+1
source

Source: https://habr.com/ru/post/1334373/


All Articles