How can I always run a custom script in Visual Studio 2015, even if nothing has changed... but using VS without VS++ installed?
I effectively want to do the same as this question however, my installation of Visual Studio 2015 does not have VC++ installed (as everything we do is either C# or VB.Net) so I do not have access to the same project properties pages.
Using the accepted answer as a starting point, and this article for more details I have added the following to my project file, but I simply cannot get it to run the custom script unless a file in the project has changed...
<PropertyGroup>
<ItemDefinitionGroup>
<CustomBuildStep>
<Command>MyScript.vbs</Command>
<Outputs>$(TargetName).missing</Outputs>
<Inputs>$(TargetFileName)</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
</PropertyGroup>
<PropertyGroup>
<CustomBuildAfterTargets>ClCompile</CustomBuildAfterTargets>
<CustomBuildBeforeTargets>Link</CustomBuildBeforeTargets>
</PropertyGroup>
I have done a lot of searching for values for <CustomBuildAfterTargets> and <CustomBuildBeforeTargets> but I cannot find anything official or otherwise. It's highly frustrating for the MS article not to provide details on possible values.
I did also try adding the <DisableFastUpToDateCheck> attribute as per one of the answers, but that still rebuilds the project so isn't what I want.
I ran into a similar problem while trying to run a script that generated source code from a folder's contents.
I managed to trigger the Custom Action every time by adding a directory to the list of Inputs:
I hoped that the build system might detect changes to the directory and subsequently run the custom build step. It does not. Instead, it seems to always run the custom action.
Caveat: I do not know if this is documented behavior. It could be purely accidental or based on my environment.