This is a cross-post of this MSE post that users commented that it is appropriate for MO.
I want to know
Question: Is the 2-dimensional Gauss-Bonnet theorem applicable (any topological or geometrical obstruction) in higher dimensions?
My idea is that one can consider 2-dimensional embedded submanifolds of $(M^n,g)$ and then applying Gauss-Bonnet theorem to all of such submanifolds then collecting these information together somehow and finding a topological or geometrical property (like fundamental group, Homology groups, etc.). Is that possible at all?