tags:

views:

59

answers:

0

We have a build machine that gets files for MSBuild from source control (SourceGear Vault). Occasionally, developers check in components and later decide to exclude those components from Visual Studio project. When build process gets the latest from source control, these excluded files also get picked up. This causes a problem to the build process. MSBuild fails saying that it ‘could not load type (removed component). I believe MSBuild tries to compile everything in the folder, and fails on these abandoned files. Is there a way to programmatically stop MSBuild from picking up these components?

Below is a way to reproduce this error.

  • Create a web application project in Visual Studio
  • Add a new component to the project (call it test.aspx)
  • Compile (you can see that it compiles fine)
  • Add a web deployment project by right clicking on the project
  • Compile (you can see that it compiles fine)
  • Right click on ‘test.aspx’ and exclude it from project
  • Compile ( it gives error ‘Could not load type..’)

If you publish using Visual Studio it still works fine. What is the difference between MSBuild and the publish from the IDE? How do make it behave the same?