You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.NotSupportedException: Method ExecuteAsync is not supported on this proxy #220
I'm using Microsoft.PowerPlatform.Dataverse.Client version 0.5.10 inside a .NET 6 Blazor Server App and randomly getting error System.NotSupportedException: Method ExecuteAsync is not supported on this proxy. The code works most of the times, but every now and then I get this exception. Not really sure how to reproduce, since it's happening randomly.
Stacktrace:
Unhandled exception. System.NotSupportedException: Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken)
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.RetrieveMultipleAsync(QueryBase query)
at ***.GetAccounts(String filter, Int32 limit)
at ***.SearchAccounts(String filter)
at Blazored.Typeahead.BlazoredTypeahead`2.Search(Object source, ElapsedEventArgs e)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__127_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
Could the issue be because IOrganizationServiceAsync2 is not marked with ServiceContractAttribute and it's method not marked with OperationContractAttribute ?
dbug: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[16]
Added WebClient Header Hooks to the Request object.
dbug: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[16]
Initialize Dataverse connection Started - AuthType: ExternalTokenManagement
info: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[8]
Cloned Connection, Retrieve version info from connected Dataverse organization not called
info: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[8]
External Dataverse Connection Provided, Skipping Validation
dbug: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[16]
New Batch Manager Created, Max #of Batches:50000, Max #of RequestsPerBatch:5000
dbug: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[16]
Execute Command - RetrieveMultiple : RetrieveMultiple to Dataverse via IOrganizationService : RequestID=ed3e946e-d7ca-4980-8832-bd2a46b8e833
dbug: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[16]
No retry attempted for Command RetrieveMultiple
fail: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[2]
************ NotSupportedException - RetrieveMultiple : RetrieveMultiple to Dataverse via IOrganizationService |=> Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
Source: System.Private.ServiceModel
Method: GetMethodData
DateUTC: 21/12/2021
TimeUTC: 9.34.10
Error: Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
HelpLink Url: Not Provided
Stack Trace: at System.ServiceModel.Channels.ServiceChannelProxy.GetMethodData(MethodCall methodCall)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
at generatedProxy_1.ExecuteAsync(OrganizationRequest )
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.<>c__DisplayClass53_0.<ExecuteAsyncCore>b__0()
at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsyncCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsync(OrganizationRequest request)
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.Command_ExecuteAsyncImpl(OrganizationRequest req, String errorStringCheck, CancellationToken cancellationToken, Boolean bypassPluginExecution)
======================================================================================================================
System.NotSupportedException: Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
at System.ServiceModel.Channels.ServiceChannelProxy.GetMethodData(MethodCall methodCall)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
at generatedProxy_1.ExecuteAsync(OrganizationRequest )
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.<>c__DisplayClass53_0.<ExecuteAsyncCore>b__0()
at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsyncCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsync(OrganizationRequest request)
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.Command_ExecuteAsyncImpl(OrganizationRequest req, String errorStringCheck, CancellationToken cancellationToken, Boolean bypassPluginExecution)
fail: Microsoft.PowerPlatform.Dataverse.Client.ServiceClient[2]
[TerminalFailure] Failed to Execute Command - RetrieveMultiple : RequestID=ed3e946e-d7ca-4980-8832-bd2a46b8e833 : RetrieveMultiple to Dataverse via IOrganizationService duration=00:00:00.0390319 ExceptionMessage = Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
System.NotSupportedException: Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
at System.ServiceModel.Channels.ServiceChannelProxy.GetMethodData(MethodCall methodCall)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
at generatedProxy_1.ExecuteAsync(OrganizationRequest )
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.<>c__DisplayClass53_0.<ExecuteAsyncCore>b__0()
at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsyncCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClientAsync.ExecuteAsync(OrganizationRequest request)
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.Command_ExecuteAsyncImpl(OrganizationRequest req, String errorStringCheck, CancellationToken cancellationToken, Boolean bypassPluginExecution)
Unhandled exception. System.NotSupportedException: Method ExecuteAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.RetrieveMultipleAsync(QueryBase query, CancellationToken cancellationToken)
at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.RetrieveMultipleAsync(QueryBase query)
at ***.GetAccounts(String filter, Int32 limit)
at ***.SearchAccounts(String filter)
at Blazored.Typeahead.BlazoredTypeahead`2.Search(Object source, ElapsedEventArgs e)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__127_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
I got this error as well (on a different WCF client), it started when I upgraded to .NET 6 (but I'm not 100% sure that's the cause, since I also started to use the WCF client differently). But my issue was that I wasn't calling Close (or CloseAsync) on the client after each use, so I think I ran out of resources and got the NotSupportedException.
Martin Björkström (@bjorkstromm) what are the conditions you're running the blazer server with?
IE:
are you seeing this under load?
are you creating a thread pool to work with ?
did you use a ServiceClient as a static? or are you creating based on request?, if so how? (connection string or constructor)
Martin Björkström (@bjorkstromm) what are the conditions you're running the blazer server with?
IE:
are you seeing this under load?
are you creating a thread pool to work with ?
did you use a ServiceClient as a static? or are you creating based on request?, if so how? (connection string or constructor)
thanks.
I've noticed that I'm only seeing this when running code with hot-reload (dotnet watch run). I see this exception usually after I've saved some changes to the code, and hot-reload have been performed.
I have a singleton ServiceClient, created lazily which I clone for each request. After each request is finished, I dispose the cloned client.
Martin Björkström (@bjorkstromm)
We are having a heck of a time reproducing this. So far we have not seen it.
would you be willing to share a sample project where this is happening?
Exception message:
"Request has failed, reason: Method GetCreditReportProductsAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute."
Activity
bjorkstromm commentedon Dec 21, 2021
Could the issue be because
IOrganizationServiceAsync2is not marked withServiceContractAttributeand it's method not marked withOperationContractAttribute?bjorkstromm commentedon Dec 21, 2021
Some more logs.
HakanL commentedon Jan 26, 2022
I got this error as well (on a different WCF client), it started when I upgraded to .NET 6 (but I'm not 100% sure that's the cause, since I also started to use the WCF client differently). But my issue was that I wasn't calling Close (or CloseAsync) on the client after each use, so I think I ran out of resources and got the NotSupportedException.
MattB-msft commentedon Jan 27, 2022
Martin Björkström (@bjorkstromm) what are the conditions you're running the blazer server with?
IE:
are you seeing this under load?
are you creating a thread pool to work with ?
did you use a ServiceClient as a static? or are you creating based on request?, if so how? (connection string or constructor)
thanks.
bjorkstromm commentedon Jan 27, 2022
I've noticed that I'm only seeing this when running code with hot-reload (
dotnet watch run). I see this exception usually after I've saved some changes to the code, and hot-reload have been performed.I have a singleton ServiceClient, created lazily which I clone for each request. After each request is finished, I dispose the cloned client.
MattB-msft commentedon Feb 17, 2022
Martin Björkström (@bjorkstromm)
We are having a heck of a time reproducing this. So far we have not seen it.
would you be willing to share a sample project where this is happening?
kbiasci commentedon Mar 9, 2022
I have the same problem, the WCF service is also a singleton but I close it everytime after use.
The name of the function called is not exactly the same as the name of the operation contract.
Could it have become an issue?
Contract:
Exception message:
"Request has failed, reason: Method GetCreditReportProductsAsync is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute."