Genetic prerequisites for the evolution of sexual dimorphism, sex-specific heritabilities and low or negative genetic correlations between homologous traits in males and females are rarely found. However, sexual dimorphism is evolving rapidly following environmental change, suggesting that sexual dimorphism and its genetic background could be environmentally sensitive. Yet few studies have explored the sensitivity of the genetic background of sexual dimorphism on environmental variation. In this study, on Drosophila melanogaster, we used a large nested full-sib-half-sib breeding design where families were split into four different developmental temperatures: two constant temperature treatments of 25 and 30 °C and two cycling temperatures with means of 25 and 30 °C, respectively. After emergence, we tested heat shock tolerance of adult flies. We found that sexual dimorphism was strongly affected by temperature during development. Moreover, we found that female heritability was significantly lower in flies developing at hot temperature and more so under hot and cycling temperatures. Interestingly, most of the genetic variation for heat shock tolerance was orthogonal (i.e. noncorrelated) between sexes, allowing independent evolution of heat shock tolerance in males and females. These findings give support to the hypothesis that the evolution of sexual dimorphism can be influenced by the environments experienced during development.