<p>We're building an C# .NET app which will be running on computers sitting inside trucks.  We need to talk to Digital IO ports on the truck computers which do not exist on our developer machines, so I need to write a dummy library which will be included in our dev builds, but will be replaced with our actual Digital IO library when we do releases.  And I want this library substitution to be automated by the build process.</p>

<p>Coming from a Java background, I can do this easily in maven using build profiles.  Is there a similar way I can do it using MSbuild??  If not, whats the best way to handle this in C# microsoft land.</p>

I recently developed something similar where I assumed an interface for communicating with some embedded computers that operated servos.  To write the software that controlled these computers I
used Moq to mock
the interfaces I wrote, and then later
plugged in real classes via StructureMap
that implemented those interfaces.
I also used Moq to write the unit tests for the software controlling the machine using the same interfaces.