Skip to main content
Customer Service forum
Answered

Plug-in Profiler Error

editSubscribe (0) ShareShare
ReportReport
Posted on by 18
I am trying to debug a plug-in in my online Customer Service environment and I am getting the following error message when the plugin is triggered whilst being profiled. I get the same error for other working plugins when they profiled.
 
Exception Message: Unexpected Exception in the Plug-in Profiler
ErrorCode: -2147220891
HexErrorCode: 0x80040265
ErrorDetails: 
    OperationStatus: 3
    SubErrorCode: -2146233088
    Plugin: 
        ExceptionFromPluginExecute: PluginProfiler.Plugins.ProfilerPlugin
        ExceptionRetriable: False
        ExceptionSource: PluginExecution
        OriginalException: PluginExecution
        PluginTrace: An exception occurred during the initialization of the Plug-in Profiler.
Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: s
   at System.Convert.FromBase64String(String s)
   at PluginProfiler.Plugins.PluginLoaderUtility.RefreshAssembly(IOrganizationService service, ProfilerConfiguration config, PluginInitializationContext context)
   at PluginProfiler.Plugins.PluginLoaderUtility.RefreshPluginInitializationContext(IOrganizationServiceFactory factory, ProfilerConfiguration config, PluginInitializationContext currentContext)
   at PluginProfiler.Plugins.ProfilerBase`1.InitializeProfiler(Dictionary`2 services, T operationContext, ProfilerPluginContext& context)
 
I have uninstalled the Profiler and ensured I am using the latest version of the PRT (9.0.0.9689) to install the profiler and start profiling.
 
I am out of ideas. Can ayone help?
 
Categories:
Attachments
  • Plug-in Profiler Error
    I have confirmed that setting LegacyPluginProfiler to false allows me to debug plugins within packages.  Thanks to "Community member" for the resolution!
  • Verified answer
    Community member Profile Picture
    Community member 13 on at
    Plug-in Profiler Error
    To debug plug-ins that are part of a plug-in package, you must: (Do not install profiler it's old now, you don't need to install profiler anymore)
    1. Use the latest version of the Plug-in Registration tool (PRT). Version 9.1.0.184 or higher.
      Use the pac CLI pac tool prt command with the --update switch to update. > pac tool prt --update
    2. In the folder that contains the PRT, edit the appsettings.json file. Set LegacyPluginProfiler to false.
      If you have installed using pac CLI, the folder should be:
      C:\Users\<you>\AppData\Local\Microsoft\PowerPlatform\PRT\9.1.0.184\tools
    3. From PRT tool Select Settings>Logging to Plugin Trace >> Select ALL
    4. In D365 environment, go to Advanced settings -> System settings -> Customizations tab. For Enable logging to plug-in trace log select value as All
    5. rest is same
    Other tips: 
    log some Trace in your plugin code using ITraceLogger. (There is a bug which will soon get fixed) 
     
     var localPluginContext = new LocalPluginContext(serviceProvider);
     localPluginContext.Trace($"Entered");

    Feel free to drop email to my gmail andy.ravi if still not getting this fixed.
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 5,769 Super User on at
    Plug-in Profiler Error
    Hello User,
     
    For the debugging have you tried to use FakeXRM ? this assembly does not even required the plugin registration tool.
     
     
    Thank you,
    Amit Katariya
  • Plug-in Profiler Error
    I am facing the same issue. Are there any updates on this issue? 
  • Roddas77 Profile Picture
    Roddas77 18 on at
    Plug-in Profiler Error
    No, I have not found an answer to this issue as yet.
  • Alen79 Profile Picture
    Alen79 2 on at
    Plug-in Profiler Error
    I'm facing the same issue. Any update on how this can be solved? There surely there must be a way of debugging plugins part of .nuget package? 
  • Plug-in Profiler Error
    I'm running into the error as well.   I've traced it to the pluginassembly table.  The content column was NULL for the assembly I was trying to profile.   After using SQL4CDS in the XrmToolbox to update the content field, I was able to profile the plugin.   How did you register the plug-in assembly?

    Edited to add:   The issue is the plugin registration method.  If you register it using a package, the assembly is saved to the File Store.  The Profiler Plug-in (which hasn't been updated since 2015) expects the assembly to be saved to the Database.  As a result, it throws the ArgumentNullReference. 

    TLDR:   The Plugin Profiler Solution needs to be updated to be aware of the File Store SourceType for plugin assembly storage.
  • Plug-in Profiler Error
    I'm getting the same error. Did you manage to find a solution?

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Demystifying Copilot with Sundar Raghavan

Sundar explains how Copilot for Service is meant to function separately...

Business Process Guidance Badges and New…

The Microsoft Success by Design is the framework for implementing Dynamics 365…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,277 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,989 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans