Working on my app to allow backups to skydrive, I was able to get the "SignIn" button to work properly. After further refinement I'm starting to use LiveAuthClient.InitializeAsync but it seems no matter where I put it (UI thread or not) or what scopes I pass I always get the error:
"An unhandled exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Windows.ni.dll"
with the following call stack:
System.Windows.ni.dll!MS.Internal.JoltHelper.OnUnhandledException(object sender, System.UnhandledExceptionEventArgs args)
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.ni.dll!System.Net.Browser.ClientHttpWebRequest.InvokeGetResponseCallback.AnonymousMethod__1b(object state2)
mscorlib.ni.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state)
mscorlib.ni.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.ni.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.ni.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
mscorlib.ni.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()
mscorlib.ni.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[Native to Managed Transition]
Code:
Microsoft.Live.LiveAuthClient auth = new Microsoft.Live.LiveAuthClient("ClientId");
auth.InitializeCompleted += auth_InitializeCompleted;
auth.InitializeAsync(new string[] { "wl.signin", "wl.offline_access", "wl.skydrive_update" });
Using Windows Phone 7.1 with VS 2012 express for Windows Phone with Version 5 of the Live SDK. Any help/insight would greatly be appreciated!