Modular invariance is a necessary condition for the consistency of any clos
ed string theory. In particular, it imposes stringent constraints on the sp
ectrum of orbifold theories, and in principle determines their spectrum uni
quely up to discrete torsion classes. In practice, however, there are often
ambiguities in the construction of orbifolds that are a consequence of the
fact that the action of the orbifold elements on degenerate ground states
is not unambiguous. We explain that there exists an additional consistency
condition, related to the spectrum of D-branes in the theory, which elimina
tes these ambiguities. For supersymmetric orbifolds this condition turns ou
t to be equivalent to the condition that supersymmetry is unbroken in the t
wisted sectors, but for non-supersymmetric orbifolds it appears to be a gen
uinely new consistency condition. (C) 2000 Elsevier Science B.V. All rights
reserved.