Electromagnetic Casimir effect on the boundary of a D-dimensional cavity and the high temperature asymptotics