Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming project output in visual studio using post build event generates error

I want to rename the project exe output in visual studio 2010. Following the post Rename project output before being included into Setup project I always get the error The command rename ... exited with code 1

My command is:

rename $(TargetDir)$(TargetFileName) newname.exe
like image 517
Maro Avatar asked Dec 04 '12 13:12

Maro


People also ask

How do I rename a project in Visual Studio 2019?

Right-click on the project name & click reload the project. Then rename the project name as highlighted below & save. It will automatically rename the . csproj file.

What is post build event?

Post-build event will only run when the compiler's output file (.exe or . dll) is different than the previous compiler output file. Thus, a post-build event is not run if a project is up-to-date.


2 Answers

Here is a correct command for the Post-build event

rename "$(TargetPath)" "newname.exe"
like image 135
GenZiy Avatar answered Oct 24 '22 05:10

GenZiy


I want to rename the project exe output in visual studio 2010.

I suggest you go into the project settings and change the output assembly name then. That's going to be far simpler and more reliable than using a post-build event.

It's possible that the fact that your current post-build command has an unmatched double-quote is the problem, but I wouldn't try to fix it - I'd just avoid it.

like image 25
Jon Skeet Avatar answered Oct 24 '22 06:10

Jon Skeet