The asymmetry in the production cross-section σ of D± mesons,AP=σ(D+)−σ(D−)σ(D+)+σ(D−), is measured in bins of pseudorapidity η and transverse momentum pT within the acceptance of the LHCb detector. The result is obtained with a sample of D+→KS0π+ decays corresponding to an integrated luminosity of 1.0 fb−1, collected in pp collisions at a centre of mass energy of 7 TeV at the Large Hadron Collider. When integrated over the kinematic range 2.0<pT<18.0 GeV/c and 2.20<η<4.75, the production asymmetry is AP=(−0.96±0.26±0.18)%. The uncertainties quoted are statistical and systematic, respectively. The result assumes that any direct CP violation in the D+→KS0π+ decay is negligible. No significant dependence on η or pT is observed.