This paper presents an exact analytical solution to the extended Graetz problem in microchannels and microtubes, including axial heat conduction, viscous dissipation, and rarefaction effects for an imposed constant wall temperature. The flow in the microchannel or microtube is assumed to be hydrodynamically fully developed. At the same time, the first-order slip-velocity and temperature jump models represent the wall boundary conditions. The energy equation is solved analytically, and the solution is obtained in terms of Kummer functions with expansion constants directly determined from explicit expressions. The local and fully developed Nusselt numbers are calculated in terms of the Péclet number, Brinkman number, Knudsen number, and thermal properties of the fluid. The constant pressure drop along the streamwise direction per unit length is imposed at a constant value and independent of the flow parameters, unlike the usual practice of fixing the average velocity. This solution can be used as the reference solution for optimization problems to enhance heat transfer using a fixed pressure drop. It is found that for no viscous dissipation and negligible axial heat conduction, the local Nusselt number is larger for imposed pressure drop compared to imposed average velocity. The thermal entrance length increases as the Knudsen number or the degree of temperature jump increases for imposed pressure drop, while it is approximately unchangeable for imposed average velocity. The quantitative differences between the cases of imposed pressure drop and imposed average velocity in the average Nusselt number over the largest thermal entrance length are reduced with the increase of axial heat conduction or viscous dissipation effects. The fully developed Nusselt number is the same for imposed pressure drop and imposed average velocity.