I’ve had this issue from time to time. For me, seems like it’s only a 7-10 day issue. The first couple years I had birds I got traps, researched wether I could feed back the dead flies, etc. Year three on, I just let them go. They were gone a week later and the birds were none the worse. I don’t know specifically where they lay eggs, but I haven’t found a way to prevent a hatch o black flies in the coop.