Let M be a closed manifold which admits a foliation structure F of codimension q ≥ 2 and a bundle-like metric g0. Let [g0]B be the space of bundle-like metrics which differ from g0 only along the horizontal directions by a multiple of a positive basic function. Assume Y is a transverse conformal vector field and the mean curvature of the leaves of (M, F, g0) vanishes. We show that the integral M Y (R T g T )dµg is independent of the choice of g ∈ [g0]B, where g T is the transverse metric induced by g and R T is the transverse scalar curvature. Moreover if q ≥ 3, we have M Y (R T g T )dµg = 0 for any g ∈ [g0]B. However there exist codimension 2 minimal Riemannian foliations (M, F, g) and transverse conformal vector fields Y such that M Y (R T g T )dµg = 0. Therefore, it is a nontrivial obstruction for the transverse Yamabe problem on minimal Riemannian foliation of codimension 2.