We report on the onset of fluid entrainment when a contact line is forced to advance over a dry solid of arbitrary wettability. We show that entrainment occurs at a critical advancing speed beyond which the balance between capillary, viscous, and contact-line forces sustaining the shape of the interface is no longer satisfied. Wetting couples to the hydrodynamics by setting both the morphology of the interface at small scales and the viscous friction of the front. We find that the critical deformation that the interface can sustain is controlled by the friction at the contact line and the viscosity contrast between the displacing and displaced fluids, leading to a rich variety of wetting-entrainment regimes. We discuss the potential use of our theory to measure contact-line forces using atomic force microscopy and to study entrainment under microfluidic conditions exploiting colloid-polymer fluids of ultralow surface tension.