I understand that Switzerland was neutral during the war. But I don’t understand why neither side eventually decided to violate their neutrality to get an upper hand on their opponent. Germany had already done that very thing with Belgium at the beginning of the conflict. So I’m surprised after the stalemate that had become the western front, that neither side chose to invade Switzerland and use their open border to attack the enemy. Couldn’t they possibly catch the other off guard and not as well defended and create a hole in the enemy’s line? Was Germany weary of invading another neutral country? Were the allies uncomfortable with losing the moral high ground by following in the German footsteps? Was opening another part of the front just seen as too impractical? Was the size and scope of invasions too great to hope the other wouldn’t notice this too early and prepare adequate defenses?
While Germany and France wouldn't have to cross the Alps to fight against each other, they still would have to cross the Jura Mountains. Switzerland was aware of that and strengthened those fortresses. It also helped that Switzerland's army was quite big: it had 250'000 active soldiers.
Schlieffen was aware of that. In his plan from 1905 he advised against invading Switzerland in one single sentence: the taking of the Jura fortresses would take too much time, time that would help the French.
There were other factors as well: In contrast to Belgium Switzerland didn't have coal or others natural resources, so apart from a (not so ideal) route Germany wouldn't gain much by invading Switzerland. On the other hand, Germany had nothing to fear from Switzerland: In the eve of WWI, the German speaking part of Switzerland and especially the government and the majority of officers were unofficially pro-German.
From 1915, France on the other hand was thinking about invading Switzerland to attack Germany from the south. But they also realized soon that this so-called "Plan H"/"Operation Helvétie" couldn't be successful. So they tried to cooperate with the Swiss: if Germany would infringe Swiss borders, the French would help Switzerland. Over the years there were different attempts to such a pact (even including Italian and British troops), but nothing was achieved.