The patterns of parasite sharing among hosts have important implications for ecosystem structure and functioning, and are influenced by several ecological and evolutionary factors associated with both hosts and parasites. Here we evaluated the influence of fish diet and phylogenetic relatedness on the pattern of infection by parasites with contrasting life history strategies in a freshwater ecosystem of key ecological importance in South America. The studied network of interactions included 52 fish species, which consumed 58 food types and were infected with 303 parasite taxa. Our results show that both diet and evolutionary history of hosts significantly explained parasite sharing; phylogenetically close fish species and/or species sharing food types tend to share more parasites. However, the effect of diet was observed only for endoparasites in contrast to ectoparasites. These results are consistent with the different life history strategies and selective pressures imposed on these groups: endoparasites are in general acquired via ingestion by their intermediate hosts, whereas ectoparasites actively seek and attach to the gills, body surface or nostrils of its sole host, thus not depending directly on its feeding habits.