Applying symbology from a .lyr or .lyrx file has been an on-going battle for me. I had an earlier post describing a problem with 1.4. I was able to get past that, but now find a different problem at 2.0.
I am in the process of upgrading a couple of applications from 1.4 to 2.0 I have encountered a problem when I attempt to apply the symbology of a .lyr or .lyrx file to a layer brought into the session by the application. This had been working in 1.4
I wanted to see how Pro itself handled this by running the GeoProcessing Tool "Apply Symbology From Layer" interactively through native Pro. I manually brought in a non symbolized grid layer into Pro. I ran the tool and entered the grid layer as the input layer. For the Symbology layer, I navigated to a .lyrx file that is built from a different but identically structured grid. As soon as I finished browsing to this file and selected it, the "ApplySymbology From Layer" tool 'seized up'.
Regarding the .lyrx file. I am able to add it directly to a pro-session with no problems and proper symbolization. If I do this, I am able to run the Apply Symboloby From Layer tool interactively, using the just added grid (from the .lyrx) file as the symbol layer and the tool works. It appears the version 2.0 tool only works with fully qualified layers that have been added to the session and not with providing it .lyr or .lyrx files that point to and are symbolized the same way.
I have a series of screen captures illustrating this experience with using the tool with a .lyrx file and then with a layer already added to Pro.
This image shows a non symbolized grid file added to Pro
This image shows trying to run the tool using a .lyrx file as the symbology layer source. This image also shows the output screen from Visual Studio that captures how it behaved after adding the .lyrx file to the Symbology Layer input:
It simply seizes up.
As a test to make sure the .lyrx file I was using was healthy, I added it to the Pro session through the Add Data button. This image shows it successfully added:
The following image shows running the Apply Symboloby From Layer tool using the just added GRID from the .lyrx file. When I populate the Symbology Layer input, the tool does not misbehave:
This seems to confirm that the tool is not properly handling .lyrx files when provided as a the symbology source.
Any assistance is appreciated. I will be unable to reply to any responses for a few days.