In this letter, a new approach to perform edge detection is presented using an all-dielectric CMOS-compatible metasurface. The design is based on guided-mode resonance which provides a high quality factor resonance to make the edge detection experimentally realizable. The proposed structure that is easy to fabricate, can be exploited for detection of edges in two dimensions due to its symmetry. Also, the trade-off between gain and resolution of edge detection is discussed which can be adjusted by appropriate design parameters. The proposed edge detector has also the potential to be used in ultrafast analog computing and image processing.