This picture in Wikipedia is supposed to explain the solenoid formula for the magnetic field $$B l= \mu_0 N I$$ (assuming steady currents).
But this would be true if one consider only the part of the curve inside the solenoid. What about the part of the curve outside the solenoid. There the field is not null, since it must loop from pole + to pole -.
Thinking about, that's curious: we could extend the exterior part of the curve to infinity to make the formula exact. But then, Ampere law seems to be wrong since the integral of the magnetic field along the curve depends on the curve, while it should be always equal to $$\mu_0 N I.$$