The aim of this thesis was to gain more insight into the genetic mechanisms important for microglia development and the role of microglia in disease. The discovery that microglia-specific gene expression, and by extension likely their function, is largely determined by their microenvironment stresses the need to study microglia in vivo.