Skip to main content
Home Forums Silverlight Programming Visual Studio & Silverlight Development Tools Debugging on a Mac
5 replies. Latest Post by jamlew on July 29, 2008.
(0)
davidpni
Member
66 points
82 Posts
07-29-2008 11:55 AM |
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.
jamlew
Contributor
2856 points
435 Posts
07-29-2008 12:25 PM |
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
07-29-2008 12:48 PM |
1. Install the Macintosh Silverlight for Developers runtime (Silverlight.2.0_Developer.dmg).
07-29-2008 12:57 PM |
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
07-29-2008 1:34 PM |
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?
07-29-2008 4:36 PM |
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.