Agreed. Buy for utility rather than as an investment. If you end up making money selling the house at some point in the future net transaction costs I'd consider it a bonus.
That said, IMO buying a house with the goal of selling it in a 2-5 years is foolish.