In this work, we investigate the quantum theory of the Kalb–Ramond fields propagating in D-dimensional de Sitter space–times using the dynamic invariant method developed by Lewis and Riesenfeld [J. Math. Phys.10, 1458 (1969)] to obtain the solution of the time-dependent Schrödinger equation. The wave function is written in terms of a c-number quantity satisfying the Milne–Pinney equation, whose solution can be expressed in terms of two independent solutions of the respective equation of motion. We obtain the exact solution for the quantum Kalb–Ramond field in the de Sitter background and discuss its relation with the Cremmer–Scherk–Kalb–Ramond model.