Unanswered argument error

  • sabato 19 novembre 2011 08:18
     
     

    I using the live sdk in wp7.

    I get the CLIENT_ID and set the mobile opetion on the web site.

    When i invoke the  liveAuth.LoginAsync(scopes, callBack)  Method, it will throw ArgumentException. But only few times it running correctly.  When i debug the app with VS2010 ,it always running correctly. so i can't debug this exception.

    If i used the SignInButton it running correctly.


    • Modificato cc_net sabato 19 novembre 2011 08:21 error
    •  

Tutte le risposte

  • sabato 19 novembre 2011 19:46
     
      Contiene codice

    I get the exception by email

    StackTrace:   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, Double d)
       at System.Windows.DependencyObject.SetValue(DependencyProperty property, Double d)
       at System.Windows.FrameworkElement.set_Height(Double value)
       at Microsoft.Live.PhoneAuthClient.AuthenticateAsync(String consentUrl, String redirectUrl, Boolean silent, Action`2 callback)
       at Microsoft.Live.LiveAuthClient.LoginAsync(IEnumerable`1 scopes, Object userState)
       at LiveHubService.SkyDriverService.<>c__DisplayClass7.<Login>b__4(Object s, LoginCompletedEventArgs e)
       at Microsoft.Live.LiveAuthClient.<>c__DisplayClass2.<RaiseAuthCompletedEvent>b__0()
       at Microsoft.Live.SynchronizationContextWrapper.<>c__DisplayClass1.<Post>b__0(Object state)
       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, StackCrawlMark& stackMark)
       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
       at System.Delegate.DynamicInvokeOne(Object[] args)
       at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
       at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
       at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
       at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
    
    
    Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
    

     

  • martedì 22 novembre 2011 23:38
     
     

    Hi, can you share more details about your problem? Is this happening in the emulator? Does it happen on an actual device? If you're not using the signin control, how are you calling the LiveAuthClient APIs? If you can share your code, it would help us understand the problem.

     

    Thanks.

    Shelly

  • mercoledì 23 novembre 2011 08:48
     
      Contiene codice

    Hi, can you share more details about your problem? Is this happening in the emulator? Does it happen on an actual device? If you're not using the signin control, how are you calling the LiveAuthClient APIs? If you can share your code, it would help us understand the problem.

     

    Thanks.

    Shelly

    HI:

      public override void Login(LiveAsyncCallback callBack)
            {
                try
                {
                    string[] allScopes = { "wl.signin", "wl.basic", "wl.share", "wl.birthday", "wl.emails", "wl.skydrive_update", "wl.skydrive", "wl.photos" };
                    var scopes = new List<string>(allScopes);
                    liveAuth = new LiveAuthClient(CLIENT_ID, REDIRECT_URL);
                    liveAuth.InitializeCompleted += (s, e) =>
                    {
                        try
                        {
                            if (e.Error == null)
                            {
                                liveAuth.LoginCompleted += OnLogin;
                                liveAuth.LoginAsync(scopes, callBack);
                            }
                            else
                            {
                                callBack(new LiveAsyncResult() { IsSuccess = false, ErrorMessage = e.Error.Message });
                            }
                        }
                        catch (Exception ex)
                        {
                            FileOperate.WriteDebugInfo(ex);
                            callBack(new LiveAsyncResult() { IsSuccess = false, ErrorMessage = ex.Message });
                        }
                    };
                    liveAuth.InitializeAsync();
                }
                catch (Exception ex)
                {
                    FileOperate.WriteDebugInfo(ex);
                    callBack(new LiveAsyncResult() { IsSuccess = false, ErrorMessage = ex.Message });
                }

    This is my login method on WP7 will be invoked on app startup.

     

     I connect my device to the zune, and startup by vs2010 in debug mode. It's running correctly. Then i disconnect the device form my pc. Then startup the app by click the tile. Then the app is crash. I add the try..catch..scope and wrote the exception stackTrace into a file. You can see the exception in my last reply. The LoginAsync throw the exception.

     

    But only few times ,it run correctly, i can entry the signin or grant page. I have deploy my app on HTC TITAN and Mozart, they have the same porblem. I don't konw why it will not crash if i startup by vs2010. I also found that.when i startup by vs2010,i saw the output windows,it's throw a ArgumentException. May be it's catch by the VS2010, so it will not crash:

    'UI Task' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\mscorlib.dll'
    'UI Task' (Managed): Loaded 'System.Windows.RuntimeHost.dll'
    'UI Task' (Managed): Loaded 'System.dll'
    'UI Task' (Managed): Loaded 'System.Windows.dll'
    'UI Task' (Managed): Loaded 'System.Net.dll'
    'UI Task' (Managed): Loaded 'System.Core.dll'
    'UI Task' (Managed): Loaded 'System.Xml.dll'
    'UI Task' (Managed): Loaded '\Applications\Install\74F6CF14-1E07-49B1-A334-3B8BDADBF3F8\Install\MyLiveHub.dll', Symbols loaded.
    'UI Task' (Managed): Loaded 'Microsoft.Phone.dll'
    'UI Task' (Managed): Loaded 'Microsoft.Phone.Interop.dll'
    A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll

     Finally i do not use this code to atou singin. I add a singin button ,and it works fine.

    • Modificato cc_net mercoledì 23 novembre 2011 08:52 edit format
    •