C# Live SDK LiveAuthClient.InitializeAsync错误

C# Live SDK LiveAuthClient.InitializeAsync错误,c#,windows-phone-7,onedrive,windows-live,C#,Windows Phone 7,Onedrive,Windows Live,通过我的应用程序允许备份到skydrive,我可以让“登录”按钮正常工作。在进一步细化之后,我开始使用LiveAuthClient.InitializeAsync,但似乎无论我将其放在何处(UI线程与否)或传递什么范围,我总是会得到错误: "An unhandled exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Windows.ni.dll" 使

通过我的应用程序允许备份到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]
代码:


使用Windows Phone 7.1和VS 2012 express for Windows Phone以及Live SDK版本5。如有任何帮助/见解,将不胜感激

可能是愚蠢的答案,但是

我想“ClientId”只是您发布的代码中的一个占位符,对吗


否则,在应用程序注册后获得的正确客户端ID应该在那里

可能是愚蠢的答案,但是

我想“ClientId”只是您发布的代码中的一个占位符,对吗

否则,在应用程序注册后获得的正确ClientId应该存在

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" });