This is a migrated thread and some comments may be shown as answers.

Unable to connect to silverlight apps

9 Answers 227 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 03 Mar 2011, 02:57 PM
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()

9 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 03 Mar 2011, 10:41 PM
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!
0
Matt
Top achievements
Rank 1
answered on 04 Mar 2011, 10:09 AM

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
0
Matt
Top achievements
Rank 1
answered on 04 Mar 2011, 11:02 AM
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
0
Matt
Top achievements
Rank 1
answered on 04 Mar 2011, 11:16 AM

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.
0
Cody
Telerik team
answered on 08 Mar 2011, 02:25 PM
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!
0
Matt
Top achievements
Rank 1
answered on 08 Mar 2011, 03:18 PM
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
0
Cody
Telerik team
answered on 08 Mar 2011, 04:43 PM
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!
0
Matt
Top achievements
Rank 1
answered on 08 Mar 2011, 05:02 PM
0
Cody
Telerik team
answered on 10 Mar 2011, 10:08 PM
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!
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Answers by
Cody
Telerik team
Matt
Top achievements
Rank 1
Share this question
or