Setting exe name according to project configuration in VS.NET 2005 [modified]
-
I have windows form application project named foo and I have created two solution/project configurations namely foo_STD and foo_PROF. Now, when I build all configurations It generates two folders under bin i.e. foo_STD and foo_PROF and executable created in both folder has name foo.exe Is there any way to change executable name through Post-Build/Command line parameters in project configuration so, that foo_STD.exe is created in foo_STD directory and foo_PROF.exe is created in foo_PROF directory.
Regards, MaulikCE
modified on Tuesday, July 22, 2008 12:38 PM
-
I have windows form application project named foo and I have created two solution/project configurations namely foo_STD and foo_PROF. Now, when I build all configurations It generates two folders under bin i.e. foo_STD and foo_PROF and executable created in both folder has name foo.exe Is there any way to change executable name through Post-Build/Command line parameters in project configuration so, that foo_STD.exe is created in foo_STD directory and foo_PROF.exe is created in foo_PROF directory.
Regards, MaulikCE
modified on Tuesday, July 22, 2008 12:38 PM
I found the solution from here- http://www.fearlessdog.com/posts/2005/03/04/net-post-build-script-to-rename-appconfig Here's the exact copy-paste script to set executable name according to project configuration Paste the following in "Post-build event command line"
rename $(TargetFileName) $(ConfigurationName)$(TargetExt)
rename $(TargetFileName).config $(ConfigurationName)$(TargetExt).configand
select "When build updates the project output" in "Run the Post-build event:" dropdown.
then hit -F6 to build the solution.
Regards, MaulikCE