One of the things I have been doing lately with my projects like the DotNetNuke CodeEndeavors AJAX templates along with the ClientAPI and WebControls is to use a custom MSBuild script to package the code up as part of the project's compilation. Since a csproj/vbproj file is already a MSBuild script this is rather simple. The problem I had was that the editing of these files within Visual Studio was cumbersome. Having to right-click on the project in Solution Explorer and choose Unload Project, then right-click again and choose Edit xxxxx.vbproj, then make my modifications, then right-click again to reload the project was getting annoying. As you may have seen, my code uses an external targets file that is referenced inside my project file, therefore, it can be opened like any other project file to edit.
Depending on whether you have a Visual Basic or C# project, your project file will already have one of these references included.
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Adding your own target file for your current project is as simple as this
<Import Project="$(MSBuildProjectDirectory)\DNNModule.Targets" />
This alleviates the constant right clicking, with one minor drawback. In order for the new script to be used, the project still needs to be unloaded and reloaded. A little less annoying and something that can be solved via a custom macro to make it a simple hotkey away.
One of the ignorant decisions I made for these templates was the need to add my overridden target for the BeforeBuild and AfterBuild events inside the project file
<Target Name="BeforeBuild">
<CallTarget Targets="SetVersionInfo" />
</Target>
<Target Name="AfterBuild">
<CallTarget Targets="DeployFiles" />
</Target>
Thought it would be worth noting that this is not necessary, simply override these Targets inside your custom targets file, thus making the "hidden" build script logic inside the project file as minimal as possible (a simple Imports). Hope this proves useful to someone.