In 1758 Louis XV decided to build a new château in the middle of his gardens, which he had been working on for more than a decade. He commissioned royal architect Ange-Jacques Gabriel to build a new royal residence large enough to house the king and some of his entourage.
http://en.chateauversailles.fr/discover/estate/estate-trianon/petit-trianon