Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Plugin Registration tool bug when profiling

Posted on by 31
I'm trying to debug a workflow and I went through the regular process I would do for a plugin and adapted for workflows.
  1. Built .dll file on VS2022 
  2. registered using PRT 
  3. Installed Profiler 
  4. Selected 'Start profiling workflow' under the new Plug-in Profiler in PRT
  5. Triggered my workflow
  6. Unregistered the profiler
  7. Back to VS2022, I Selected Debug > Attach to Process 
  8. Selected Plugin Registration Tool (notice it starting the process)
  9. Then in PRT I selected the Replay Plug-in Execution
  10. Selected latest profile and my .dll (assembly) file. (At this point I see the black bar on top indicating debug is working)
  11. I hit Start Execution and I see the error below.
Bug error:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Could not load file or assembly 'file:///C:\Users\...\bin\Release\System.Memory.dll' or one of its dependencies. The system cannot find the file specified.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <a:key>CallStack</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark&amp; stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at PluginProfiler.Library.AppDomainProxy.LoadAssembly(AssemblyName name, Dictionary`2 assemblies)
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)</a:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <HelpLink i:nil="true" />
  <Message>Could not load file or assembly 'file:///C:\Users\...\bin\Release\System.Memory.dll' or one of its dependencies. The system cannot find the file specified.</Message>
  <Timestamp>2024-09-17T21:59:23.7102372Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
    <ErrorCode>0</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <HelpLink i:nil="true" />
    <Message i:nil="true" />
    <Timestamp>0001-01-01T00:00:00</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>
 
One thing that I noticed after investigating my generated profile is that it seems not to have worked, although I get no error message in PRT and can still select it when trying to replay.

Error in the profiler Plug-in Trace Log:
<All the regular logging is here up to the point the code breaks>
Failed to generate app Reference: Exception: Entity 'sharepointdocumentlocation' With Id = xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Does Not Exist
Unexpected Exception occurred in Profiler while persisting the profile:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing.
<OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ActivityId>ea0fbf2d-9f3c-423c-8cfc-9957ac67688f</ActivityId><ErrorCode>-2146893812</ErrorCode><ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"><KeyValuePairOfstringanyType><a:key>ApiExceptionSourceKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Api/PostPipeline</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiSourceActivityKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema"/></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiExceptionOwnerKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">OwnershipNotFoundInExceptionOwnerSettings</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiOriginalExceptionKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Microsoft.Crm.CrmException: ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing.&#xD;
at Microsoft.Crm.BusinessEntities.ExecutionContext.ThrowIfInvalidPluginTransaction(Int32 countThreshold)&#xD;
at Microsoft.Crm.BusinessEntities.ExecutionContext.CommitTransaction(ProcessDependenciesOption option, FlushCacheOption flushOption)&#xD;
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)&#xD;
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.&lt;&gt;c__DisplayClass5_0.&lt;Execute&gt;b__0()&#xD;
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)&#xD;
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)&#xD;
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, Guid callerRegardingObjectId, Int32 invocationSource, Version endpointVersion, OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)&#xD;
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.DispatchRequest(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest, SdkResponseDescription responseDescription, SdkPerformanceCounterContext sdkPerformanceCounterContext, IHttpContext httpContext)&#xD;
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequestRequestWithInstrumentation(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)&#xD;
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequestRequestWithInstrumentationOperation(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)&#xD;
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.&lt;&gt;c__DisplayClass27_0.&lt;ExecuteRequest&gt;b__0()</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiStepKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">00000000-0000-0000-0000-000000000000</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiDepthKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">3</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiActivityIdKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">ea0fbf2d-9f3c-423c-8cfc-9957ac67688f</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiPluginSolutionNameKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiStepSolutionNameKey</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiExceptionCategory</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">ClientError</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiExceptionMessageName</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">IsvTransactionCount</a:value></KeyValuePairOfstringanyType><KeyValuePairOfstringanyType><a:key>ApiExceptionHttpStatusCode</a:key><a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">400</a:value></KeyValuePairOfstringanyType></ErrorDetails><HelpLink>http://go.microsoft.com/fwlink/?LinkID=398563&amp;error=Microsoft.Crm.CrmException%3a8009000c&amp;client=platform</HelpLink><Message>ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing.</Message><Timestamp>2024-09-17T20:47:12</Timestamp><ExceptionRetriable>false</ExceptionRetriable><ExceptionSource>SdkClientError</ExceptionSource><InnerFault i:nil="true"/><OriginalException>System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing. (Fault Detail is equal to Exception details: &#xD;
ErrorCode: 0x8009000C&#xD;
Message: ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing.&#xD;
TimeStamp: 2024-09-17T20:47:12.9807701Z&#xD;
--&#xD;
).</OriginalException><TraceText i:nil="true"/></OrganizationServiceFault>
at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.<>c__DisplayClass16_1.<ExecuteStreamingCallBack>b__1(ExecuteRequest response)
at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.GrpcClientSendAndReceive(ExecuteResponse executeResponse, Func`2 isTerminalResponse)
at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.<>c__DisplayClass16_0.<ExecuteStreamingCallBack>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.ExecuteStreamingCallBack(Func`2 callback, Func`2 isTerminalChunk, Func`2 HandleClientException)
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationService.Execute(String operation, ByteString serializedRequest, Assembly proxyTypes, Object traceSettings)
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationServiceWrapper.<>c__DisplayClass23_0.<ExecuteInternal>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request)
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationServiceWrapper.CreateInternal(Entity entity)
at PluginProfiler.Plugins.ServiceWrappers.OrganizationServiceWrapper.Create(Entity entity)
at PluginProfiler.Plugins.ProfilerBase`1.Execute(T operationContext, ProfilerPluginContext context, ProfilerPluginReport report, Object inputParameter)

 

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans