Hi,Thank you for submitting this bug report. As part of optimizing the serialization of layers for printing, GraphicsLayer without Graphics are ignored. But we should include a check that the GraphicsLayer is not a FeatureLayer for this may also mean that the layer is simply not initialized (as in your case).For the meantime, as a workaround you can add a temporary graphic to a FeatureLayer that is not yet initialized before you execute print.
if(!layer.IsInitialized) // Note that if FeatureLayer is already initialized, this may cause an edit.
layer.Graphics.Add(new Graphic()); // this graphic will be cleared after FeatureLayer.UpdateCompleted is raised.
mapLayers.Add(layer);
Do the workaround above before executing a print. In code below, t is PrintTask, r is the PrintResult.
var r = await t.ExecuteTaskAsync(new PrintParameters(mapLayers, mapExtent)
{
ExportOptions = new ExportOptions()
{
OutputSize = new Size(200, 200)
}
});
We'll try to get this fixed in future releases of the API.Jennifer