C# Visual Studio – Change the AppName on Build

Here’s how to automatically rename your .exe file during build in a C# WinForms (or any .NET Framework) project:

Post-build Rename (with dynamic value)

Inside Visual Studio:

  1. Right-click on your project → Properties
  2. Go to Build EventsPost-build event command line
  3. Add:
rename "$(TargetDir)YourOriginalName.exe" "MyNewAppName.exe"