No problem…and you are correct. Illustrator does not treat a line that “looks” dashed as a single path dashed line. (That’s because it’s just an appearance of dashing, not actual dashes.)
The easiest way to deal with it in Illustrator is to create a dashed brush, which is very easy to do, and then just apply the brush to the path that you want to be dashed. We have a tutorial for it here: