Are you new to MSBuild? Check out our Hands-On-Lab

This MSBuild Hands-On-Lab introduces you to the fundamentals of MSBuild.  It talks about the basics such as how to hand-author a simple MSBuild project file, and then builds on that to show you how to take it all the way to more advanced aspects such as incremental builds and target level dependency analysys (TLDA), authoring custom tasks, Visual Studio and how it relates to MSBuild, how Visual Studio integrates MSBuild, and all that good stuff.  Check it out!

[Author: Faisal Mohamood]

Comments (7)

  1. Chris Martin says:

    Thanks for that.

    However there are some errors in the doc. On page XV.

    1. Augment the Csc task so that it takes not only sources but also .resources files. Add the following attribute to your Csc task:


    2. Edit your "Build" target to account of the new inputs. Your target input tag should now also address the new GeneratedResources input. Change the Inputs attribute in your build target to look like this:


    "@(GeneratedResourceFiles)" should be "@(Content)"

  2. Mike Fourie says:


    The example seems to be correct. I went in to make the change you suggested, and noticed that it works as expected. The GenerateResource task takes the set of @(Content) items and produces the output in item named @(GeneratedResourceFiles). These items are then passed into the Csc task as the set of .resources. @(GeneratedResourceFiles) contains the set of resources expected by the compiler.

    Does this make sense?

    Faisal Mohamood

  3. Subramaniyan says:


    In the lab7 , Learn about MSBuild / Visual Studio integration , when i try to debug the application as per the lab, it displayed the following error:

    "VISUAL Studio cannot start debugging because the debug target ‘C:SubuMSBuildBinMsBuildSample.exe is missing . Please build the project and retry or set the outputpath and assemblyname properties to point to the correct location for the target assembly."

    Please help me to resolve this error.

    Thanks for the good hands on lab.


  4. Faisal Mohamood says:

    Hi Subramaniyan,

    Yes you are correct in that you will not be able to debug this application in Step 7. This is because the project that you are trying to debug is hand-authored, and until step 8, we haven’t quite done everything that Visual Studio will need to fully interact and do interesting things like "Debug" for the hand authored project.

    You should be able to build fine however. Have you been able to debug the application after you completed Step 8?


    Faisal Mohamood

    MSBuild Team

  5. Raskal says:

    Great hands-on-lab.

    You could add a short exercice about the creation of custom build action that you present in this other post :

  6. Thank you for making this available. I have included it in a list of useful MSBuild resources that I have compiled in doing research on creating automated builds for my own projects:

    I will definitely be keeping an eye on this blog as I continue to work with MSBuild.

    Good job.

  7. Geraldo says:

    Wanted to try out the Hands On Lab but I get a 404 – File or directory not found. Can someone please make it available again?