I have a map in the MapServer that contains a group layer as shown here. When I add it as a layer inside Map Viewer, I get a dotted line where the drawing info on my layer (lines_for-advanced_symbols_1) is not applied.
However, when I add only the layer by itself to the map viewer, it is rendered with its drawing info and renders as a solid line.
Is this expected, why is the drawing info not used when it is added within the map?
Yup this is expected. When adding it as a MapServer url the rendered line is coming from the server in an exported image which can give you that dashed symbol. When you use the direct layer url like MapServer/2 it gets treated as a feature layer and the symbol can be the simplified renderer. You can use vector symbols from a web style to style the MapServer/2 case to look like the exportedImage scenario.