Live SDK LiveAuthClient.InitializeAsync error



在我的应用程序上工作以允许备份到Skydrive,我能够让"登录"按钮正常工作。经过进一步的改进,我开始使用LiveAuthClient.InitializeAsync,但似乎无论我把它放在哪里(UI线程与否)或我传递什么范围,我总是得到错误:

"An unhandled exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Windows.ni.dll" 

使用以下调用堆栈:

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]

法典:

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" });
使用 Windows Phone

7.1 和 VS 2012 Express for Windows Phone 和 Live SDK 版本 5。任何帮助/见解将不胜感激!

可能是愚蠢的答案,但是...

我想"ClientId"只是您发布的代码中的一个占位符,对吧?

否则,应用注册后获得的正确客户端 ID 应存在

最新更新