The misfit stress in a thin layer embedded in a semi-infinite matrix has been first determined near the free surface of the structure, using the virtual dislocation formalism. From a Peach–Koehler force analysis, the different equilibrium positions (unstable and stable) of an edge dislocation gliding in a plane of the layer inclined with respect to the upper interface and emerging at the point of intersection of the upper interface and this free surface have been then characterized with respect to the lattice mismatch and the inclination angle of the gliding plane. It has been found that the dislocation may exhibit stable equilibrium position near the interface and/or near the free surface. A diagram of the position stability has been then determined versus the misfit parameter and the inclination angle. The energy variation due to the introduction of an edge dislocation from the free surface until the matrix layer interface has been finally determined, when the dislocation is gliding in the plane inclined with respect to the interface horizontal axis. A critical thickness of the layer beyond which the formation of the dislocation in the interfaces is energetically favorable has been finally determined as well as its position with respect to the free surface in the lower interface.