Programmatically Resolve Assembly Name to Full Path the Same Way MSBuild Does

Jomo Fisher—Every once in a while I find I need to turn and assembly name like “System” or “System.Core, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL” into a path to the actual file for that assembly. This is a tricky problem considering the assembly name might be for a product install in Program Files or elsewhere. MSBuild already…


Hack the Build: Use ILMerge and MSBuild to Combine Multiple Assemblies into One

Jomo Fisher–Over the last few years I’ve been coding mostly in C#–before that, my day-to-day work was done in C++. I don’t miss much about C++, but one of the things that I do miss is the ability to link many .LIB files into a single DLL or EXE I’ve known that it was possible…


Update: Targetting 1.1 .NET Framework with MSBuild

A while back I post a sample that shows you how to target the 1.1 framework with MSBuild. Now, another team within Microsoft is working on turning it into a more polished add-on for VS 2005: I’ve chatted with many of you on my blog and I think I know some of your top requests…


How to plug your own C# compiler into VS 2005.

Jomo Fisher–A bunch of future C# compiler features (think 3.0 and beyond) will be on display at PDC in a couple of weeks. We wanted to ship a nice installation that lets people try out the new features of the compiler while still leaving VS 2005 working for regular 2005 C# projects. MSBuild made this…


Hack the Build: Use the Whole Test-First Whale

Jomo Fisher—  Try lots of things to improve quality. Keep doing what works, stop doing what doesn’t. Writing code with Test-Driven-Development (TDD) takes about 30% longer than writing code without it. This was my experience on MSBuild. Still, as I noted here and here, I’m a fan of TDD. Code quality tip #2 explains why……


Hack the Build: An Introduction to MSBuild

Mitch Denny gives an excellent introduction to MSBuild: This posting is provided “AS IS” with no warranties, and confers no rights.


Hack the Build: Update to 1.1 targets

Jomo Fisher – Oren pointed out that the wrong resource compilation was being done in the 1.1 targets I posted. I’ve corrected the problem so you may want to take another snapshot of the targets files. He also pointed out that, at debug time, the FX 2.0 versions of framework assemblies were being loaded, not the…


Hack the Build: Use Whidbey Beta2 to target .NET Runtime 1.1

Jomo Fisher – A while back, I posted a sample that showed how to target the .NET 1.1 runtime (the version that came with Visual Studio .NET 2003 also known as Everett) with MSBuild. Now Beta 2 has rolled around and I can see that there have been enough changes to MSBuild to warrant an entire…


Hack the Build: Cracking MSBuild Project Files

Jomo Fisher — Here’s how you can use the MSBuild Object Model to programmatically access the contents of a project file. This sample console application accepts a single parameter–the full path to some MSBuild project file–and displays all of the assemblies that project references: using System; using System.IO; using Microsoft.Build.BuildEngine;   class MSBuildCracker {      …


Hack the Build: Hide Items from Visual Studio Solution Explorer

Jomo Fisher — Custom MSBuild projects and targets files that you write typically have ItemGroups to contain lists of files. For example, <ItemGroup> <MyFiles Include=”a.txt”/></ItemGroup> When you fire up VS with the above code in a project you’ll find that “a.txt” shows up in the solution explorer. Depending on how you intend these items to be used…