How it works...

In step 1, we started by installing the profile into our Dynamics 365 instance (for details on how to connect, check the Deploying your customization using the plugin registration tool recipe in Chapter 3, SDK Enterprise Capabilities). Behind the scenes, this will install a managed solution with the Plug-in Profile entity, the PluginProfiler.Plugins plugin, as well as some Web Resources and a Site Map extension:

In step 2 and step 3, we enabled an existing plugin step for profiling and set up the profiling configuration. The dialog in step 3 is self-explanatory. We opted for the default option of throwing an exception when the plugin being profiled runs; however, you can opt to persist the profile in a Dynamics 365 entity (Plug-in Profile that shipped with the Plug-in Profiler managed solution). You can also limit the number of times the plugin profiler triggers.

Next, in step 4, we triggered the plugin being profiled and we were prompted with an exception that contains an encoded execution profile.

In step 5 and step 6, we attached Visual Studio to the Plugin Registration tool process.

In step 7 to step 9, we passed in the details of the plugin to execute, associated it with the profile we got from our Dynamics 365 instance, and started executing the plugin locally. Behind the scenes, the plugin registration tool loads the plugin assembly and executes the plugin by passing the context as if it was executing within Dynamics 365; however, it will run locally. In fact, the replayed plugin will still connect to your Dynamics 365 live instance to execute the rest of the plugin.

Finally, in step 10, we ensured that the profiler has been disabled in order to ensure no further exceptions are returned when we try to execute the plugin in Dynamics 365 again.

You can automatically turn off profiling by limiting the number of profiled executions while setting up your profiler.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.36.221