Unable to connect to silverlight apps

10 posts, 0 answers
  1. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 03 Mar 2011 Link to this post

    Hi,

    I'm having an issue running automated tests driving a silverlight app.  I've gone through all the browser configuration and checked I can run sample tests without an issue, so it's likely to be something wrong in my code.

    The Manager settings are initialised as:

     var settings = new Settings
                                   {
                                       EnableSilverlight = true,
                                       ExecutionDelay = 50,
                                       EnableUILessRequestViewing = false,
                                       QueryEventLogErrorsOnExit = false,
                                       EnableScriptLogging = false,
                                       AnnotateExecution = true,
                                       AnnotationMode = AnnotationMode.All,
                                       RecycleBrowser = true,
                                       DefaultBrowser = BrowserType.InternetExplorer,
                                   };


    The browser is connecting via https with navigation and automation on htmlinput elements working OK, but whenever it tries to connect to the silverlight app I get the stack trace below - tested on two seperate machines (one server 2003 x86,  one windows 7 x64):

    ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!

    InError set by the client. Client Error:

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x000003E9): System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Silverlight.ObjectSerializer' threw an exception. ---> System.InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.

    at System.RuntimeType.get_GenericParameterPosition()

    --- End of inner exception stack trace ---

    at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)

    at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)

    --- End of inner exception stack trace ---

    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)

    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)

    at ArtOfTest.InternetExplorer.JsObjectWrapper.Call(String methodName, Object[] args)

    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)

    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)

    BrowserCommand (Type:'Silverlight',Info:'NotSet',Action:'NotSet',Target:'ElementId (tagName: 'object',occurrenceIndex: '0')',Data:'{"Method":null,"Property":null,"Reference":null,"Reference2":null,"Type":10,"Value":"FrameworkElement;CheckBox;ChildWindow;ComboBox;DataGridCell;DataGridRow;DataGrid;RadioButton;RepeatButton;DataGridCellsPresenter;DataGridColumnHeader;DataGridColumnHeadersPresenter;DataGridDetailsPresenter;DataGridFrozenGrid;DataGridRowHeader;DataGridRowsPresenter;Calendar;CalendarButton;CalendarDayButton;CalendarItem;DatePicker;DatePickerTextBox;GridSplitter;PreviewControl;TabControl;TabItem;TabPanel;Shape;Path;Ellipse;Line;Polygon;Polyline;Rectangle;Glyphs;Panel;Image;Canvas;TextBlock;MediaElement;InkPresenter;MultiScaleImage;StackPanel;Control;TextBox;PasswordBox;Grid;ItemsControl;Border;ContentControl;ContentPresenter;ItemsPresenter;Popup;UserControl;ButtonBase;Button;ToggleButton;Selector;HyperlinkButton;ListBox;RangeBase;ScrollBar;Thumb;ScrollContentPresenter;ScrollViewer;Slider;ToolTip;ProgressBar;ListBoxItem;ComboBoxItem;VirtualizingStackPanel;"}',ClientId:'Client_d284ca17-4bc1-4219-a0e9-56a2af98f06b',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x000003E9): System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Silverlight.ObjectSerializer' threw an exception. ---> System.InvalidOperationException: Method may only be called on a Type for which Type.IsGenericParameter is true.

    at System.RuntimeType.get_GenericParameterPosition()

    --- End of inner exception stack trace ---

    at System.Windows.Browser.ManagedObjectInfo.Invoke(ManagedObject obj, InvokeType invokeType, String memberName, ScriptParam[] args)

    at System.Windows.Hosting.ManagedHost.InvokeScriptableMember(IntPtr pHandle, Int32 nMemberID, Int32 nInvokeType, Int32 nArgCount, ScriptParam[] pArgs, ScriptParam& pResult, ExceptionInfo& pExcepInfo)

    --- End of inner exception stack trace ---

    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)

    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

    at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)

    at ArtOfTest.InternetExplorer.JsObjectWrapper.Call(String methodName, Object[] args)

    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)

    at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')

    InnerException: none.

    at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)

    at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)

    at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)

    at ArtOfTest.WebAii.Silverlight.SilverlightProxy.PublishKnownControlTypes(List`1 knownTypes)

    at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect(Int32 timeout)

    at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect()

    at ArtOfTest.WebAii.Silverlight.SilverlightAppsList.get_Item(Int32 index)

    Helpers\TestHelper.cs(15,0): at Insurer.Analytics.Acceptance.Test.Helpers.TestHelper.get_SilverlightApp()

  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 03 Mar 2011 Link to this post

    Hello Matt,

    Silverlight application testing over HTTPS with IE (IE only, this is not supported by other browsers) is expected to work just fine. I asked my Silverlight automation developer to look at the trace. All we can tell is that something is going wrong inside of our hooks into your Silverlight application. To further diagnose this problem we need a local repro in our source code development environment. Is there anyway we can get direct access to your application i.e. a publicly accessible website we can hit to study this problem?

    Also have you tried using a HTTP connection? It may behave exactly the same, but it would be a useful piece of information to help us track down this issue.

     

    Kind regards,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 04 Mar 2011 Link to this post


    Hi Cody,

    I'm afraid I can't get a public conneciton set up.  We're also using Windows Identity Foundation, so we can't easily turn https off, but the Silverlight example app from the WIF training kit uses the same approach so you may be able to use that to reproduce the issue (if it's due to https/wif)

    I did a bit more digging and connected the debugger to the IE process. The exception is being thrown from ReflectionUtils.GetAssemblies()

    Matt
  4. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 04 Mar 2011 Link to this post

    Never mind - I've managed to get the WIF sample working without problems, so it's not that.  I'll keep trying to come up with some sample code for you.

    Matt
  5. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 04 Mar 2011 Link to this post


    Some more info.

    I've managed to isolate the app from WIF and run without https - the same error occurs.

    The application uses Prism 4 with the unity container for service location, referencing telerik and infragistics control sets.  Application library caching is used for all external assemblies, the the app itself is split up into a shell xap and a number of independent xap modules, loaded on demand at startup.
  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 08 Mar 2011 Link to this post

    Hi Matt,

    We really need a way of getting a local repro of this problem before we can investigate further... either in the form of a public website we can access, or sending us a complete sample application we can install and run on our own internal web server.

     

    Best wishes,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  7. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 08 Mar 2011 Link to this post

    Hi Cody,

    I've put together a stripped down xap file with just our application shell and a website and test project that demonstrate the issue.  Can you let me know where I can send it to?

    Thanks,

    Matt
  8. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 08 Mar 2011 Link to this post

    Hello Matt,

    If you place the entire Visual Studio solution into a .zip file, is it less then 10MB? If so you should be able to attach that .zip file to a forum post as a file attachment. I can then download it. If you're worried about security (since this is a public forum) let me know and I'll create a private DropBox just for you that you can upload it to.

     

    Kind regards,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. Matt
    Matt avatar
    6 posts
    Member since:
    Aug 2010

    Posted 08 Mar 2011 Link to this post

    Here you go.
  10. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 10 Mar 2011 Link to this post

    Hello Matt,

    Thank you very much for the sample application! I've managed to repro the problem. I have submitted PITS 5082 to track this issue. We will try to get this resolved very soon.

    Greetings,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top