Until the end of World War I, Liechtenstein was closely tied first to the Austrian Empire and later to Austria-Hungary; the ruling princes continued to derive much of their wealth from estates in the Habsburg territories, and spent much of their time at their two palaces in Vienna. Johann II appointed Carl von In der Maur, an Austrian aristocrat, to serve as the Governor of Liechtenstein. The economic devastation caused by the war forced the country to conclude a customs and monetary union with its other neighbour, Switzerland.