2

I have created sample windows form based application.(Exe name is Sample.exe)

I renamed ‘Sample.exe’ to maximum length of characters allowed by windows before launching.

I am getting an error (CLR error:8007007a. The program will now terminate.) enter image description here

Can anyone please let me know how to resolve this issue.

2
  • 1
    It is a low-level Windows error, ERROR_INSUFFICIENT_BUFFER, "The data area passed to a system call is too small". Well, surely you can figure out how this happened and what to do about it, you don't need our help. A cleaner exception would be nice, you can report this at connect.microsoft.com Commented Aug 1, 2015 at 8:29
  • @HansPassant, How would you "surely figure out" based on ERROR_INSUFFICIENT_BUFFER that renaming files to shorter names will solve the problem? That is what solved it for me as per DeJaVo's answer. Commented Mar 10, 2016 at 11:02

1 Answer 1

6

Individual components of a filename (i.e. each subdirectory along the path, and the final filename) are limited to 255 characters, and the total path length is limited to approximately 32,000 characters. However, you should generally try to limit path lengths to below 260 characters ( MAX_PATH ) when possible

Don't rename your file to be longer than 260 characters.

Renaming the file back to something considerably smaller should fix it.

If you want to change the Executable file name:

  • Change the project
  • Rebuild

In such way you keep consistent and you can trace back from your executable to the source code if there is a problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.