1

Is it possible to have Visual Studio produce a different filename in the bin\Debug folder from the bin\Release folder?

Ideally I'd like to see bin\Debug\Application.Debug.exe and bin\Release\Application.exe.

Perhaps there is a script I can add? I'm just tired of doing this manually.

Michael Mankus
  • 4,628
  • 9
  • 37
  • 63

3 Answers3

2

A suitable post build step would be this:

if NOT $(ConfigurationName)==Debug goto done
del $(ProjectName).debug.exe
copy $(TargetFileName) $(ProjectName).Debug.exe
:done

(Assuming $(ProjectName) is the same as the executable name without the .exe suffix.)

It doesn't need to be in a batch file; paste it straight in to the post build settings.

Originally, instead of the copy I was just renaming the .exe like so:

ren $(TargetFileName) $(ProjectName).Debug.exe

But that had a really annoying drawback - when you go to debug, it says the .exe is missing (which it is of course). So I ended up just making a copy.

Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
1

I would use a batch file in the post build event, that will rename your Application.exe to Application.Debug.exe.

Axarydax
  • 16,353
  • 21
  • 92
  • 151
0

I don't believe VS has that funcitonality baked in, but you could easily craft a post build event for debug build to rename your file from Application.exe to Application.Debug.exe

Jason
  • 3,844
  • 1
  • 21
  • 40
  • Will this affect my ability to debug within VS? – Michael Mankus May 15 '13 at 18:54
  • @michael.mankus I believe it will as VS won't be able to find `Application.exe`, another thing you can do if you want to still be able to debug is make a copy of the file with the new name, but you'll end up with two copies of the same file with different names – Jason May 15 '13 at 18:56