AFAIK, VS uses the same implementation of the MSBuild engine but has some sleazy (buggy) performance optimizations. Add the property DISABLEFASTUPTODATECHECK=1 to get the same behavior.
We found this allowed us to eliminate differences we saw and found hard to track down and infuriating:
For some reason, when I was wrestling with that problem, all I could find was other people on forums with the same problem, and an acknowledgement that MS tried to keep the differences minimal. (I think, too, that some of the larger discrepancies must have been fixed with newer releases of VS... I recall things breaking even with VS's regular build command, not just when debugging.)
We found this allowed us to eliminate differences we saw and found hard to track down and infuriating:
https://msdn.microsoft.com/en-us/library/vstudio/ms171468%28...