Answered by:
Synchronize Fails in Windows mobile : Value can not be null. Parameter name: SyncContext

Question
-
This exception occurs when calling synchronization method of Sync Agent in Windows Mobile.Synchronization works successfully but this exception occurs randomly.
Message
Value can not be null. Parameter name: SyncContext
StackTrace
at Microsoft.Synchronization.Data.SyncExpt.CheckArgumentNull(Object value, String parameterName)
at Microsoft.Synchronization.SyncAgent.UploadChanges(SyncGroupMetadata groupMetadata)
at Microsoft.Synchronization.SyncAgent.Synchronize()
at PreCom.Sync.Client.SyncClientAgent.Sync()
at PreCom.Sync.Client.PreComSyncClient.Synchronize()
at PreCom.Sync.GuiModule.frmGuiModule.btnSync_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Windows.Forms.Control.TASK.Invoke()
at System.Windows.Forms.Control._InvokeAll()
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at PreCom.Application.Initialize()
at PreCom.ApplicationMobile.Main()
Friday, April 8, 2011 12:48 PM
Answers
-
Thank you,
this occurred randomly.
I have used a socket connection to the server and when receive method fails the SyncContext becomes null.
Did some fixes to my receive method and now it works fine.
- Marked as answer by Yunwen Bai Wednesday, May 4, 2011 7:37 PM
Wednesday, May 4, 2011 12:03 PM
All replies
-
Does this happen consistently or randomly?
Can you enable trace on both client and server and see whether you can see details for the sync exception?
Monday, April 11, 2011 5:33 PMAnswerer -
Thank you,
this occurred randomly.
I have used a socket connection to the server and when receive method fails the SyncContext becomes null.
Did some fixes to my receive method and now it works fine.
- Marked as answer by Yunwen Bai Wednesday, May 4, 2011 7:37 PM
Wednesday, May 4, 2011 12:03 PM -
Good to know that worked.
thanks for the info.
Yunwen
This posting is provided "AS IS" with no warranties, and confers no rights.Wednesday, May 4, 2011 7:37 PM