Skip to main content

Microsoft Silverlight

Answered Question Debugging on a MacRSS Feed

(0)

davidpni
davidpni

Member

Member

66 points

82 Posts

Debugging on a Mac

Sorry about the duplicate post.  I posted this on the "Programming in C# - General" forum before realizing that this forum existed, and this question that I have is much more suited for this forum.  So here goes:

I need to debug my Silverlight on a Mac running Safari, but I have not found any resources so far that explain how you can do so.  I found a couple of old resources that explain how to do so with Silverlight 1.1, but that is old and I using Beta 2.

 The Silverlight 1.1 resources talked about a directory called "MacIntel" found in the Silverlight folder of VS 9.0 (Visual Studio 2008), but this folder no longer exists.  Now there is a folder called MacDebugging (which I assume is meant for the same purpose), but the files are different and there are no instructions on how to use them.

Anyone know how to debug Silverlight 2 Beta 2 on a Mac?

 

jamlew
jamlew

Contributor

Contributor

2856 points

435 Posts

Microsoft
Answered Question

Re: Debugging on a Mac

On this page about 1/3 down is a section titled Remotely Debugging Silverlight on a Macintosh.  If you have any issues, post back here Smile

---------
If this post has solved your problem, please select 'Mark as answer'

- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team

davidpni
davidpni

Member

Member

66 points

82 Posts

Re: Debugging on a Mac

1. Install the Macintosh Silverlight for Developers runtime (Silverlight.2.0_Developer.dmg).
Do you happen to know where this mysterious "Silverlight.2.0_Developer.dmg" download can be found? :)

jamlew
jamlew

Contributor

Contributor

2856 points

435 Posts

Microsoft

Re: Debugging on a Mac

Ah, yes.  If you go to this page there will be a link towards the bottom left for the Mac or Windows developer runtime.  Sorry it was hard to find

---------
If this post has solved your problem, please select 'Mark as answer'

- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team

davidpni
davidpni

Member

Member

66 points

82 Posts

Re: Debugging on a Mac

 Thanks!  That helps a lot.

 

Now....a continuation:

 I debugged the program, and this is the output I got:

'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/CoreCLR.bundle/Contents/MacOS/i386/mscorlib.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/CoreCLR.bundle/Contents/MacOS/en-US/mscorlib.debug.resources.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.Windows.Browser.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.Windows.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.Net.dll'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.Xml.dll'
'Safari -psn_0_6160385' (Managed): Loaded 'MySilverlightApp', Symbols loaded.
'Safari -psn_0_6160385' (Managed): Loaded 'System.Windows.Controls.Extended'
'Safari -psn_0_6160385' (Managed): Loaded 'System.Xml.Linq'
'Safari -psn_0_6160385' (Managed): Loaded '/Library/Internet Plug-Ins/Silverlight.plugin/Contents/MacOS/System.Core.dll'
A first chance exception of type 'System.NullReferenceException' occurred in System.Windows.dll

There is the problem!  Safari is throwing a NullReferenceException....but it is not occuring in my code!  It happens in System.Windows.dll.  This happens about 50% of the time when I run my Silverlight app in Safari.  As far as I can tell it is nothing in my code that is causing this to happen.

 Here is what I am doing right before the exception occurs:

The user clicks a button to open a file.  The "button click handler" function then calls another function that does the actual loading of the file.

In the other function, an "OpenFileDialog" box opens, and the user selects a file.  I read in that file (an XML file), parse the XML, and do some visualization of the XML data.  Everything successfully gets visualized (I add all the stuff to my Canvas), and the function exits.  

I then get returned to the "button click handler" function, which then successfully returns as well.

After it returns, the exception occurs.

 

Any ideas?

jamlew
jamlew

Contributor

Contributor

2856 points

435 Posts

Microsoft

Re: Debugging on a Mac

A first chance exception means that the exception hasn't been handled yet, just thrown.  Of course, this doesn't mean that it will be handled correctly.  Can you continue running your app, and does it behave correctly?  Or does this cause your app to crash and/or behave incorrectly?

If the latter, is there a sample of the code that you can share which reproduces the issue?  Thanks.

---------
If this post has solved your problem, please select 'Mark as answer'

- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities