Unusual and persistent noises from any appliance shouldn’t be ignored. Some may be serious and others might be trivial. Believe it or not, a dishwasher making whistling noise could have an unexpected cause. According to a dishwasher manual I’m just reading, one of the “malfunctions” it advises on is if, “there is a whistling noise during washing”. The advice is that this is not a cause for concern, but to try using a different brand of detergent.
It’s quite an unexpected solution and amusing to think it could be explained so simply. I can’t think of a fault that would cause an actual whistling noise although unusual noises from any appliance shouldn’t be ignored. If it doesn’t sound like it’s coming from a motor or pump, try a different brand of detergent first. You could also try running the dishwasher without any detergent in to see if the noise stops.
Apparently some dishwasher detergents cause whistling sounds and some don’t.