In my addin, I can successfully add a feature layer from a feature server to the current map using the LayerFactory, for example, adding layer 0:
LayerFactory.Instance.CreateFeatureLayer(new Uri("http://localhost:port/.../FeatureServer/0"), map);
If I try to add a different layer (from the same server), say layer 1, such as:
LayerFactory.Instance.CreateFeatureLayer(new Uri("http://localhost:port/.../FeatureServer/1"), map);
The function returns null. Using a tool like Fiddler shows that ArcGIS does not even attempt to contact the server given the URL.
Is there a particular process one should follow when adding feature layers from the same feature server?
Try using the path to the FeatureServer itself. You should get a parent composite layer ("group") that contains all of the individual layer end points (however many there are).