Add a new configuration to the project / solution. Then close the project file and open it for editing in XML. Change the DefaultTargets attribute to "PickBuild" and add the following target to the bottom of the file:
<Target Name="PickBuild"> <CallTarget Targets="Build" Condition=" '$(Configuration)' == 'Debug' "/> <CallTarget Targets="Build" Condition=" '$(Configuration)' == 'Release' "/> <CallTarget Targets="SpecialTarget" Condition=" '$(Configuration)' == 'NewConfiguration' "/> </Target>
Now, to perform a special task, the developer just needs to switch the configuration in Visual Studio and click build. And, on request, it lives inside the file, so it will work on any other computer.
source share