- Built .dll file on VS2022
- registered using PRT
- Installed Profiler
- Selected 'Start profiling workflow' under the new Plug-in Profiler in PRT
- Triggered my workflow
- Unregistered the profiler
- Back to VS2022, I Selected Debug > Attach to Process
- Selected Plugin Registration Tool (notice it starting the process)
- Then in PRT I selected the Replay Plug-in Execution
- Selected latest profile and my .dll (assembly) file. (At this point I see the black bar on top indicating debug is working)
- I hit Start Execution and I see the error below.
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& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& 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& 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>
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.
at Microsoft.Crm.BusinessEntities.ExecutionContext.ThrowIfInvalidPluginTransaction(Int32 countThreshold)
at Microsoft.Crm.BusinessEntities.ExecutionContext.CommitTransaction(ProcessDependenciesOption option, FlushCacheOption flushOption)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.<>c__DisplayClass5_0.<Execute>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, Guid callerRegardingObjectId, Int32 invocationSource, Version endpointVersion, OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.DispatchRequest(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest, SdkResponseDescription responseDescription, SdkPerformanceCounterContext sdkPerformanceCounterContext, IHttpContext httpContext)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequestRequestWithInstrumentation(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequestRequestWithInstrumentationOperation(OrganizationRequest request, OrganizationInternalRequest organizationInternalRequest)
at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.<>c__DisplayClass27_0.<ExecuteRequest>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&error=Microsoft.Crm.CrmException%3a8009000c&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: 
ErrorCode: 0x8009000C
Message: ISV code reduced the open transaction count. Custom plug-ins should not catch exceptions from OrganizationService calls and continue processing.
TimeStamp: 2024-09-17T20:47:12.9807701Z
--
).</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)