Mysterious System.ArgumentException on LoadAsync method from DataServiceCollection class, calling from Silverlight 4 ? RRS feed

  • Question

  • I have an exception being thrown on every call to LoadAsync.  I can not determine if this is something to be concerned with or not. I am using the .NET 4 Silverlight client libraries for data services.

    Calling code : (from a ViewModel class )

         _fooCollection = new DataServiceCollection<FooModel>(ctx);
          _fooCollection.LoadCompleted += new System.EventHandler<LoadCompletedEventArgs>(FooLoadCompleted);

    Exception :  (this is the whole stack trace, I know not much info)

    System.ArgumentException occurred
     Message=Type 'XMLHttpRequest' does not exist.
    Parameter name: typeName
        at System.Windows.Browser.HtmlWindow.CreateInstance(String typeName, Object[] args)
    Any ideas?

    Tuesday, February 22, 2011 8:46 PM


  • Hi,

    You can try setting the DataServiceContext.HttpStack = HttpStack.ClientHttp.


    Vitek Karas [MSFT]
    • Marked as answer by Rybolt Wednesday, February 23, 2011 2:33 PM
    Tuesday, February 22, 2011 10:22 PM