Skip to main content

Notifications

Microsoft Dynamics CRM forum
Suggested answer

In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object

Posted on by
Hello,
    Can i deserialize the Plugin Profile Xml file into IPluginExecutionContext Object? 
This XML file is saved from the View Plugin Profile feature of the Plugin Registration Tool.
Because I want to use this data to debug the plugin.
So, I want to ask how to do it.
 
Thanks!
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 7,390 Super User 2024 Season 1 on at
    In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object
    I am not sure with desealization you will get the context object.. because for testing also you need framework that can mimic D365. You can use FakeXrm for it. But here also you will have to setup test tables and data manually.
  • cheng32 Profile Picture
    cheng32 on at
    In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object
    Thanks to Amit Katariya007, it's really a version issue, after I updated to the latest version, the plugin debugging tool didn't report an error, but it would be better if I could deserialize the XML to the implementation of the IPluginExecutionContext object, so that I don't need to update the plugin DLL, I can modify the code and do unit tests directly
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 7,390 Super User 2024 Season 1 on at
    In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object
    The error you’re seeing, Microsoft.Xrm.Sdk.PluginTelemetry.ILogger could not be loaded, typically occurs if the version of Microsoft.Xrm.Sdk you're using is out of sync with the one required by the Plugin Registration Tool or by the Dynamics 365 instance. This interface, ILogger, was introduced in newer versions of the SDK, and if you’re using an older version of Microsoft.Xrm.Sdk, it won’t have this type.
  • cheng32 Profile Picture
    cheng32 on at
    In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object
    Thanks for the reply, when I used the plugin registration tool to debug the plugin, I got an error saying that the type Microsoft.Xrm.Sdk.PluginTelemetry.ILogger could not be loaded from assembly Microsoft.Xrm.Sdk
  • Amit Katariya007 Profile Picture
    Amit Katariya007 7,390 Super User 2024 Season 1 on at
    In order to debug plugin, How can i deserialize xml file into IPluginExecutionContext Object
    ​​​​​​​Can you use Plugin profilter with the visual studio for the debugging? Because it will be only way you can get details of all the various variables that are captured during execution time of plugin.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,807 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans