Why do some WPF projects build differently in VS vs MsBuild?
One of the differences between building in VS and command line is that a WPF build in VS defaults to <AlwaysCompileMarkupFilesInSeparateDomain>true</AlwaysCompileMarkupFilesInSeparateDomain>.
Outside of VS, the default is false.
We're likely changing this to default to True for VS or MsBuild (command line) scenarios for .NET 4 beta2.
If you need to, you could add that property directly to your .csproj or .vbproj.
(WPF Forum thread about this.)