The asymmetry in the production cross-section σ of D± mesons,AP=σ(D+)-σ(D-)σ(D+)+σ(D-), is measured in bins of pseudorapidity η and transverse momentum p<inf>T</inf> 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<p<inf>T</inf><18.0 GeV/c and 2.20<η<4.75, the production asymmetry is A<inf>P</inf>=(-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 p<inf>T</inf> is observed. © 2012 CERN.