There is a general tendency of students (master's or less) to rate highly those courses that create a value for them at the industry. For example, in CS, networking or OS courses are found to be attractive by many students simply because these are (almost) indispensable for most job interviews. It is difficult to find the same kind of enthusiasm for say, an optimisation course.
Another example from ECE will be courses pertaining to electromagnetism. Students generally love VLSI-based or telecommunication courses and ignore or dislike the ones on EM. Similarly there could be subfields in many areas where research has stagnated and relevant courses do not carry industrial value, but it is impossible to exclude them from the syllabus.
How does a professor teaching such a course sustain the interests of the students? How does he/she make the best out of a bad job?