Answered by:
incorrect implementation of IAsyncResult: What is this error? How do I fix it?

Question
-
I am using the standard run of the mill WCF framework in .NET 4.0 to evaluate the framework so that we can be ready to begin developing in it when it gets released. I have a client that is sending string data to a WCF service hosted under IIS on a test server and is expecting a response. Periodically I get the following error in my server logs:
Event Type: Error
Event Source: ASP.NET 4.0.30128.0
Event Category: None
Event ID: 1325
Date: 3/17/2010
Time: 1:18:03 PM
User: N/A
Computer: [REMOVED]
Description:
An unhandled exception occurred and the process was terminated.Application ID: /LM/W3SVC/1234452652/Root
Process ID: 1256
Exception: System.InvalidOperationException
Message: An incorrect implementation of the IAsyncResult interface may be returning incorrect values from the CompletedSynchronously property or calling the AsyncCallback more than once. The type System.Data.Common.DbAsyncResult could be the incorrect implementation.
StackTrace: at System.Runtime.AsyncResult.ThrowInvalidAsyncResult(IAsyncResult result)
at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Data.Common.DbAsyncResult.AsyncCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Data.Common.DbAsyncResult.ExecuteCallback(Object asyncResult)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Now, an initial search for info yeilded only one result: http://blogs.msdn.com/toddca/Default.aspx?p=2
While this provides some great information under: IIS 6 Crashing With Some Asynchronous Handlers
It does not provide a fix or solution. Is this a bug in the framework/IIS that might be corrected in the release? Should I host it in an alternative fashion? Can anyone provide some additional information on this problem.
Thanx.- Edited by ControlledChaos Wednesday, March 17, 2010 8:41 PM Clarity
Wednesday, March 17, 2010 8:38 PM
Answers
-
Can you send me a small repro to amadeoc AT microsoft.com so I can see where the problem is?
I still do not see what the features of your service are... Have you tried running any of the WCF 4.0 samples? Do they run for you? In which sense is your service different from the WCF samples that you can download from: http://www.microsoft.com/downloads/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a51a-d8ad115a8792&displaylang=en?- Proposed as answer by Amadeo Casas - MSFTModerator Thursday, March 18, 2010 3:22 PM
- Marked as answer by Amadeo Casas - MSFTModerator Friday, March 19, 2010 6:25 PM
Thursday, March 18, 2010 12:26 AMModerator
All replies
-
I am sorry, but I do not find any useful information in the links you provided. Can you publish some more information about your service so we may be able to help here? Is it a WF or a WCF service?Wednesday, March 17, 2010 8:51 PMModerator
-
Here is the precise link to the information that I found about this problem:
http://blogs.msdn.com/toddca/archive/2006/01/03/iis-6-crashing-with-some-asynchronous-handlers.aspx
I am not sure wat additional information you would like.
It is a WCF service.
Here is the contract definition:[ServiceContract(Name = "ObjectService", Namespace = "urn:IPMC.Object/2010/03")] public interface IObjectService{ [OperationContract(Name = "AddObject")] TransactionResult AddOject(TestObject obj, bool useConfirm); }
I would be happy to provide the contracts for TestObject and TransactionResult if they are needed.- Edited by ControlledChaos Wednesday, March 17, 2010 9:57 PM Clarity
Wednesday, March 17, 2010 9:55 PM -
Have you read the MSDN documentation that explains how to call WCF service operations asynchronously?
http://msdn.microsoft.com/en-us/library/ms731177.aspx
http://msdn.microsoft.com/en-us/library/ms730059.aspx
Hope this helps.Wednesday, March 17, 2010 10:17 PMModerator -
Amadeo,
That is the problem... I am calling the WCF service synchronously.
T.J.Wednesday, March 17, 2010 11:51 PM -
Can you send me a small repro to amadeoc AT microsoft.com so I can see where the problem is?
I still do not see what the features of your service are... Have you tried running any of the WCF 4.0 samples? Do they run for you? In which sense is your service different from the WCF samples that you can download from: http://www.microsoft.com/downloads/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a51a-d8ad115a8792&displaylang=en?- Proposed as answer by Amadeo Casas - MSFTModerator Thursday, March 18, 2010 3:22 PM
- Marked as answer by Amadeo Casas - MSFTModerator Friday, March 19, 2010 6:25 PM
Thursday, March 18, 2010 12:26 AMModerator