I've added a 'BeforeClean' and an 'AfterClean' target to my .csproj file, originally designed to delete some build artifacts in locations outside the normal build path.
When I did a "clean" on the project, I could tell that the files weren't getting deleted; so I dumbed down the action to just spit a message out. Like the delete command, the message command isn't getting invoked (I'm expecting to see the message in the 'Output' window).
The only relevant advice I could find on the web was to make sure that you do your target definitions after you import the Microsoft.CSharp.targets file. I'm including the clip of my .csproj file with enough detail to show where my target defs are vis-a-vis the import.
As far as I can tell, I'm doing everything right; why would my targets not get invoked?
Thanks in advance.
[Update and FYI: I was able to get the Target to fire when changing Importance from 'normal' to 'high.']
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<Target Name="BeforeClean">
<Message Text="Hello Clean World!" Importance="normal" ContinueOnError="true"/>
</Target>
<Target Name="AfterClean">
<Message Text="Goodbye Clean World!" Importance="normal" ContinueOnError="true"/>
</Target>
</Project>