The laminar-turbulent transition in boundary-layer flows is often affected by wall imperfections, because the latter may interact with either the freestream perturbations or the oncoming boundary-layer instability modes, leading to a modification of the accumulation of the normal modes. The present paper particularly focuses on the latter mechanism in a transonic boundary layer, namely, the effect of a two-dimensional(2 D) roughness element on the oncoming Tollmien-Schlichting(T-S) modes when they propagate through the region of the rapid mean-flow distortion induced by the roughness. The wave scattering is analyzed by adapting the local scattering theory developed for subsonic boundary layers(WU, X. S. and DONG, M. A local scattering theory for the effects of isolated roughness on boundary-layer instability and transition: transmission coefficient as an eigenvalue. Journal of Fluid Mechanics, 794, 68–108(2006)) to the transonic regime, and a transmission coefficient is introduced to characterize the effect of the roughness. In the sub-transonic regime, in which the Mach number is close to, but less than, 1, the scattering system reduces to an eigenvalue problem with the transmission coefficient being the eigenvalue; while in the super-transonic regime, in which the Mach number is slightly greater than 1, the scattering system becomes a high-dimensional group of linear equations with the transmission coefficient being solved afterward. In the largeReynolds-number asymptotic theory, the K′arm′an-Guderley parameter is introduced to quantify the effect of the Mach number. A systematical parametric study is carried out,and the dependence of the transmission coefficient on the roughness shape, the frequency of the oncoming mode, and the K′arm′an-Guderley parameter is provided.