Disappointed with the MSBuild Object Model
I've been working pretty heavily with MSBuild over the last few days.
Overall, I love the idea of a universal build engine, and I've been really
excited to wrap up this idea that's been in my head ever since I saw it in
But the actual implementation of the MSBuild API is, IMO, terrible. It feels
like it was built by Windows API guys, especially when you get into the
Microsoft.Build.Engine.Project class. Instead of having read-write properties
for things like directly-imported projects, there are methods like
"GetDirectlyImportedProjects". That's all well and good, but I can't bind
against that. I can't add and remove items from a collection... it's just poor
API design. Now that they're in Beta 2, the problem now is that they are stuck
with this API, and if the MSBuild team were to clean it up in the next version,
they'd have to keep the other messy stuff for a while.
The idea was good, but some of the Object Model feels like it was a rushed
prototype that never got the polish that it should have.
It doesn't help that the VS2005 object model is not much better. I can't for
the life of me figure out how to access the MSBuild instance that VS uses for
the loaded project. There is a ton of excess code in the add-in project stub
code, and there is no documentation on the names of the various toolbars and
menus to be able to add items to them.
All in all, though, the technology is great. I figured out (for the most
part) what I wanted to accomplish. I just hope they make another pass and
improve the APIs on MSBuild.