4

I'm having issues with Silverlight 4 Out-Of-Browser, as specified in the title.

What I did:
Update project settings to enable Out-Of-Browser. This enabled OOB, but when I ran the app in this way it just displayed a white screen.

What I have done to try to fix this:

  • All references to the System.Windows.Browser.HtmlPage (to avoid DOM interaction) have been removed as per various sources including this SO question and this blog post.
  • Remove any references to SizeChangedEventHandler as per this SO question.
  • Clean projects/solution, including ideas such as deleting *.suo files as per this blog post
  • Uninstalling the installed OOB app, reinstalling

Also:

  • As commented on by "kobruleht" here, attempting to attach the debugger does not appear to work. Visual Studio (2010, SP1) reports that it is attached without help from me, but breakpoints are not being hit.

And so:

Can anyone advise on other courses of action? At the very least I'd like to be able to step through and hit breakpoints (or even break on Exceptions!)

Community
  • 1
  • 1
Ben Parsons
  • 1,425
  • 1
  • 14
  • 30
  • "Visual Studio reports that it's attached without help from me, but breakpoints aren't being hit" - Have you looked at the loaded Modules via Debug.Modules in VS and ensured that Symbols have been loaded for your project? Maybe VS is attached but won't hit BPs since the Symbols aren't loaded. – Nick Nieslanik Jan 11 '12 at 19:14
  • @NickNieslanik that is a good point, I will check first thing tomorrow – Ben Parsons Jan 11 '12 at 23:27
  • If it works, I'll move my suggestion to an answer so you can mark it as a solution. – Nick Nieslanik Jan 11 '12 at 23:33
  • @NickNieslanik Symbols are loading fine, but still no breakpoints are being hit. Suspect that the code I'm trying to break on (`App.Application_Startup()`) is not being reached. Thanks for the suggestion anyway. I'm really not sure how to continue debugging this! – Ben Parsons Jan 12 '12 at 09:05
  • Have you just tried to debug the constructor for App? You should get there nearly all of the time since most XAML is parsed in the Init method call within it. – Nick Nieslanik Jan 12 '12 at 14:11
  • Yeah I did try that - thanks for continuing to think of the issue though. I'm working on something else on the project which needs to be done (and will reduce the number of `S.W.Browser` dependencies with need to be remove before testing), so I'll make sure to update this question with any new information later on. – Ben Parsons Jan 12 '12 at 23:08

1 Answers1

1

OK, I have a resolution.

In AppManifest.xml I specified assemblies to be loaded, one of these was not loading correctly, which meant that App.xaml.cs->App()was never reached. The problem is difficult to diagnose because the program runs, with no errors or exceptions, but then displays a white screen - quite misleading.

For anyone experiencing the same problem, the simplest debugging steps to take in this case is to run the app in in-browser mode, copy the results from the Output window, then compare the results from the Output window when you try to run in OOB mode. Any discrepancies will give a good hint to the problem.

I should also mention, that I have not had trouble with SizeChangedEventHandler as mentioned above.

Ben Parsons
  • 1,425
  • 1
  • 14
  • 30