A method for the manufacturing an endoscope, the method including: providing a window having a lateral peripheral surface and a flat surface, the window is provided with a metal coating on a lateral peripheral surface and/or an edge region of the flat surface, and the flat surface of the window is provided with a solder preform, inserting the window provided with the solder preform into a window seat of an endoscope shaft of the endoscope, where the flat surface of the window one of faces an interior space of the endoscope shaft or faces away from the interior space of the endoscope shaft, and subsequent to the inserting, heating the solder preform with a heating device such that solder material of the solder preform is distributed between the window and the window seat and, after the solder material cools, solder is arranged between the window and the window seat.