My code adds a layer file (.lyrx) to the map. Up to now, this was working fine as follows:
Uri myUri = new Uri(C:\<path to .lyrx>\mySymbology.lyrx);
Layer newlayer = LayerFactory.Instance.CreateFeatureLayer(myUri, MapView.Active.Map, LayerPosition.AddToTop);
Then yesterday, ArcGIS Pro popped up a message saying there was an update available, so I installed it. Silly me - I thought this would fix bugs! Now the above code no longer works. It gives me an error that says "Failed to add data, unsupported data type". Is there some other way to programmatically add a .lyrx file to the map? Or is this a bug that has been introduced? I really need for this to work.
I tried the following code snippet by using the data from community samples and tried the code below with both ArcGIS Pro 2.2 and 2.2.1. It worked with both versions. Can you please elaborate a bit about the content of the layer file?
Uri myUri = new Uri(@"C:\Data\SDK\Default2DPointSymbols.lyrx");
Layer newlayer = LayerFactory.Instance.CreateFeatureLayer(myUri,
catch (Exception ex)
I figured out the problem, and it was something incredibly stupid that I did unrelated to the update (it just coincided with installing the update). Everything is working now. So let's just considered this solved.