Sunday, September 23, 2007

MSBuild - What a tool

MSbuild is a great tool to do automatied stuff.

Introduction to <a href="" target="_blank">MSBuild</a>
I have used it for some time now on my Umbraco projects, and it really saves me alot of time.
In my project I create a MSBuild script that copies my assembly and usercontrols to my local website, every time i buíld my project.
so my debugging steps change from 7 to 5 steps.

1. Build Project
2. Copy assmbly files to bin folder on IIS [now Automated]
3. Copy ascx files to usercontrols folder on IIS [now Automated]
4. Open website in IE
5. Attach my project to w
6. Go to page that has to be debugged.
7. Find and solve problem.
My msBuld script:

<target name="PostBuildEvent">
<createitem include="$(ProjectDir)$(OutputPath)$(AssemblyName).dll">
<output taskparameter="Include" itemname="OutputFiles"></createitem>
<message text="Copying '%(OutputFiles.Filename)%(OutputFiles.Extension)' FooBar bin directory" importance="high">
<copy sourcefiles="@(OutputFiles)" destinationfolder="$(SolutionDir)bin" continueonerror="false" skipunchangedfiles="true">

Another way to use MSBuild is to have different configuration settings for production and testing environments read about it on <a href="" target="_blank">Scott Gu's blog</a>

No comments:

Post a Comment