Microwave only runs with door open!

While using the microwave to cook potatos (several loads) the microwave stopped cooking, when I opened the foor, the microwave started up and when I closed the door it stopped again. I tried unplugging it, resetting all controls ect but it still only “runs” with the door open, obviously dangerous, so I unplugged it.

Defective “monitor” door switch.