Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

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 August 2003.

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.

Comments

Mark Erikson said:

So, is this a revised version of the MSBuild Compatibility toolkit that you're working on? I'd love a solid solution for targeting the 1.1 Framework with VS2K5.
# May 19, 2005 2:12 AM

Robert McLaws said:

Yes. It's the release of the MSBuild Compatibility Toolkit targeted at VS2005 Beta 2. Hopefully I'll be finished with it soon.
# May 19, 2005 3:06 AM

Chris Flaat said:

Robert -

Yes, the MSBuild object model in the beta2 release still has some excess stuff in it that will be removed before RTM. Some types and methods, including your personal favorite GetDirectlyImportedProjects(), won't exist in the final MSBuild object model. They were redundant "convenience" API's. Anything you could do with those you can still do with the fundamental object model that remains. We weren't able to do this refactoring before beta2.

As for accessing the MSBuild instance that VS is using, there is no way to do this.

We appreciate your feedback -- keep it coming!

Chris Flaat
MSBuild Team
# May 19, 2005 4:22 PM

Robert McLaws said:

Chris,

Thanks so much for your comments. I just wanted you and your team to know that MSBuild is really great. Interacting with it can be difficult, especially for what I want to do with it.

It's good to know that you guys are making changes... I'll be looking forward to them. Thanks!

-Robert
# May 19, 2005 6:20 PM