Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

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.)

How to resolve this issue.

Thanks in advance.
Posted
Updated 31-Jul-15 21:39pm
v2

Simple: Don't rename the file to the "maximum length of characters" - whatever that means.

If you want to change the EXE file name, then change the project and rebuild: that way it is kept consistent and you can trace back from your executable to the source code if there is a problem.
 
Share this answer
 
Comments
sdileep1 23-Jul-15 3:21am    
Exe file name is fixed to 'Sample.exe'. If user changes it to maximum length of characters and try to run that, error occurs.
OriginalGriff 23-Jul-15 5:04am    
Then the user is an idiot and shouldn't do it...
User error: not your problem.
Afzaal Ahmad Zeeshan 1-Aug-15 3:58am    
Good, precise solution. 5ed
So you renamed the executable to have a 260 character filename? That's kind of stupid.

Actually, the fully qualified path to the file cannot be longer than 260 characters.

You're not entirely clear on exactly what you did.

But, in any case, renaming the file back to something considerably smaller should fix it. I would have thought that to be quite obvious.


Naming Files, Paths, and Namespaces[^]
 
Share this answer
 
"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."

So...don't rename your file!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900