During the Thirty Years War, according to Ehealthfacts, Switzerland enjoyed exceptional prosperity thanks to the destruction suffered by Germany to which it was able to sell essential commodities for many years. Once peace was concluded, the country suffered a serious crisis of overproduction which caused many troubles within, peasant revolts and an attempt by Zurich to create a central power superior to that of the individual states. The alliance with the French, which began after Marignano and lasted almost 150 years, ended during the reign of Louis XIV who, in 1678, conquered Franche-Comté (for centuries a buffer zone between France and the Confederation); in 1681 Strasbourg and the fortification of Hüningen (from which Basel could be bombed). This sovereign also revoked the edict of Nantes (1685) which granted freedom of worship to French Protestants. A renversement des alliances then took placeand Switzerland joined the Empire (1700) and the Savoy (1703) to defend itself from the too enterprising French neighbor. In that situation, the attribution to the King of Prussia of Neuchâtel (1707) was frowned upon when the Orléans-Longueville, who had owned it since 1514, albeit under Swiss tutelage, died out: this avoided the settlement in that State of French candidate, the prince of Conti. There was an exacerbation of the internal tension of the country when, during the century. XVIII, the influx of many Protestant refugees from France changed the religious balance with difficulty achieved (the Protestants rose to 700,000 against 300,000 Catholics).
The problem soon became political because there were seven Catholic Cantons in the diet and only four Protestant Cantons. Furthermore, the most productive part of the country was in the hands of the reformed. Inevitable was the armed conflict which ended in 1712 with the victory of the Protestants and the imposition of confessional parity. However, they made the mistake of demanding the possession of some of the territories managed by the cantons in common: this caused the resentment of the vanquished and the alliance of the Catholic cantons with France (1715) to recover what they had lost. The civil war, however, did not break out because, during the century. XVIII, the principle of unanimity, often neglected in the past, was meticulously applied in the votes of the diet. Within the cantons almost everywhere dominated a few families that constituted the “patriciate”, that is a closed oligarchy; it was particularly important in Bern, Lucerne, Freiburg and Solothurn, but the situation was not unlike where power was in the hands of the guilds, that is, in Zurich, Basel, Schaffhausen, St. Gallen and, to some extent, also in Bienne, Mulhouse and Geneva. This state of affairs, which had already provoked, over the course of the century, conspiracies and riots all but failed, ended with the invasion of the French revolutionary troops. France did not tolerate the Swiss policy of benevolent reception made to emigrants from the ancien régime while Switzerland did not forget the massacres of its soldiers in Paris on 10 August 1792 in the following September. These were in the service of the deposed King Louis XVI and were commanded by officers from the most prestigious Swiss aristocracy. Porrentruy, already occupied by the French in April 1792, was annexed in March 1793; Geneva was occupied in December 1792. The events of the war of the first anti-French coalition temporarily saved Switzerland, but in 1797 the victorious France detached Valtellina, Chiavenna and Bormio from the Grisons, annexing them to the Cisalpine Republic and at the beginning of 1798, at the instigation of the Swiss F The Harpe who resided in Paris and directed the revolutionary agitations especially in Vaud and Valais, the French invaded Switzerland both for strategic reasons and to seize the wealth of Bern. The fall of this city (March 5, 1798) caused the collapse of the Confederation: Mulhouse and Geneva were annexed to France a few days later; the other territories formed the Helvetic Republic, centralized on the French model. It lasted only five years and was shaken by the Austro-Russian invasion of 1799, by the brief restoration of the old aristocratic governments that soon collapsed again and by the guerrilla war that made Switzerland a second Vendée. Napoleon in 1802 he created the Republic of Valais and abandoned the military occupation of the rest of Switzerland; the unitary government was replaced by the governments of the old states that Bonaparte allowed to resurrect with the Act of Mediation (9 February 1803) on condition that the feudal privileges were not restored and that the territories once subject to the joint administration of the confederates (Vaud, Aargau, Thurgau, St. Gallen and Ticino) were elevated to the rank of canton.
The new Confederation was actually a satellite state of France and the Republic of Valais ceased to exist in 1810, when Napoleon decided to annex it to France to have in his hands the Simplon road whose construction he had imposed on Switzerland to have a faster connection between its two capitals, Paris and Milan. The collapse of Empire was not followed by a return to the ancient; the cantons created in 1803 were recognized and three new ones were added, Geneva, Neuchâtel and Valais (thus the cantons increased to 22, a number that would remain unchanged for over a century and a half, until the constitution of the 23rd canton, that of the Jura, in 1978); Geneva was territorially linked to the rest of the Confederation; Swiss neutrality was recognized as a principle of European public law; the fortifications of Hüningen were dismantled. The other aspirations (northern Savoy, Valtellina with Bormio and Chiavenna, Campione d’Italia, Ossola, Costanza, etc.) remained unsatisfied not because of the lack of skill of the Swiss representative in the European fora, Pictet de Rochemont, but because of the eternal divergence of views between the various cantons and the complexity of the diplomatic game of the big four (Great Britain, Austria, Russia and Prussia) towards the vanquished France.
The period following the Congress of Vienna it was marked first by the outbreak of a serious economic crisis caused by poor harvests, then by the return to the continental market of British products and by the imposition of heavy customs duties by neighboring states, which amounted to the closure of the cantonal borders. Within the Confederation, the states rivaled each other and proved incapable of inaugurating a unitary policy and sometimes imposed duties on the existing borders between them, as did the Valais towards Vaud, to favor their trade with foreign countries. The creation of closer ties was required, especially after the industrial revolution arrived in the country in 1839. Especially the Protestant cantons who, for the most part, had given themselves liberal constitutions, interpreted this need, they had abolished religious discrimination, suppressed the regulatory differences between town and country and had agreed between them, starting from 1832, to mutually guarantee their constitutions (Concordat of sects between Aargau, Bern, Lucerne, St. Gallen, Solothurn, Thurgau and Zurich). In the same year, some conservative and basically peasant cantons formed a league called Sarnenbund in order to keep the sovereignty of the individual cantons intact. This purely political-social conflict became a religious conflict when in 1834 the seven cantons of the Concordat elaborated a project of religious reform which was condemned by the Catholic ecclesiastical authority. The radicals went on the offensive by suppressing eight convents in Aargau (1841); the Catholics then overthrew the liberal government in Lucerne (1841) and called the Jesuits to direct the Canton school (1844). Since the radicals crossed into Lucerne territory and assassinated one of the clerical leaders, the Cantons of Lucerne, Uri, Schwyz, Unterwalden, Zug, Friborg and Valais joined together in a league called Sonderbund seeking help from Catholic (France, Austria and Sardinia) and conservative (Prussia and Russia) powers. Only Britain supported the radicals. The military clash took place in 1847 and the progressives won very quickly: in just 26 days the Sonderbund was crushed, but the moderation of the winner, General Dufour, did not cause resentment and on 12 September 1848 a Constitution was passed that transformed Switzerland from confederation of states into a federal state and which left the way open to new transformations, thus avoiding the drawbacks of rigid constitutions. Alongside the collective executive power and the Legislative Chamber, the referendum (direct democracy) was introduced which made it possible to implement changes, especially starting from 1874, which would otherwise be impossible. In this way, there was a peaceful and progressive equalization between the constitutions of the individual cantons and between these and the federal constitution, which made Switzerland a compact state while maintaining its own freedom.