After the 1798 French invasion of Switzerland and the creation of the Helvetic Republic the Abbey's estates, including Hagenwil, were nationalized. With the collapse of the Republic and the 1803 Act of Mediation, the Canton of St. Gallen was created, incorporating many of the Abbey's former estates. Two years later, in 1805, the Grand Council of the Canton decided to sell off much of the former estates including Hagenwil. Benedikt Angehrn bought the castle and in 1830 added a restaurant in the courtyard. In 1937/38 the castle was repaired and restored with the help of the Swiss Federal Office of Civil Protection. In 1985 an archeological exploration of the castle was undertaken. The old kitchen was replaced with a new, three story building in 2003/4. The castle and restaurant are still owned by the Angehrn family.