Select to view content in your preferred language

CreateRenderer Failing

272
12
a week ago
MichaelTodd
Occasional Contributor

Under what circumstances would a layer CanCreateRenderer method return true, yet running CreateRenderer with the same renderer caused the following error:

ArcGIS.Desktop.Mapping.MappingException: 'Error HRESULT E_FAIL has been returned from a call to a COM component.'

Can't nail down why the error. Everything seems to be set up correctly, using a FeatureLayer, all required elements are set in the classes. To top it off, this code has been working since at least ArcGIS Pro 2.8 and has just recently started to crash Pro. Any ideas?

0 Kudos
12 Replies
MichaelTodd
Occasional Contributor

Attached is a file geodatabase with the two files in question. I assume the code will work with them since they were exported to a file geodb. I have a feeling that the layers themselves, currently living in our Enterprise geodb (Sql Server) are corrupted (usable, but corrupted). If the attached layers work, I would hazard that as being the case.
If so, I suppose the next step is: how do I fix those layers in the Sql Server without breaking things?

0 Kudos
MichaelTodd
Occasional Contributor

Because, of course I forgot the attachment.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Your code works with file gdb you attached.

Check your map content for broken layers. If they exist, remove them and try your code

0 Kudos