An X-ray detector is manufactured bonding detector layers onto a main frame leaving a protruding edge portion extending beyond edge of the detector layers. The protruding edge portion of the main frame is then detached from the main frame along a detachment line adjacent the edge of the detector layers before a cover with a thin edge wall is applied to the detector stack.