question

anjanayadav-0022 avatar image
0 Votes"
anjanayadav-0022 asked Alexey-3235 answered

Error: can not access disposed object for OrganizationServiceProxy.Retrieve.

Hi,

I have a custom web portal that is integrated with CRM 365 to get/update data from custom pages to CRM.
It is working fine in all environment except Prod. In prod when multiple use access portal and try to get/update values , "Can not access disposed object" error is coming for oranizationserviceproxy. I have already use "using" statement to ensure object is closed regardless of exception occur
Below is random exception once portal is heavily loaded.

Inner exception System.ObjectDisposedException handled at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Microsoft.Xrm.Sdk.IOrganizationService.Execute (Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore (Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute (Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute (Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChange (Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)


dotnet-aspnet-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Alexey-3235 avatar image
0 Votes"
Alexey-3235 answered

@anjanayadav-0022, have you found a solution? I faced with the same problem.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.