Frequently Asked Questions
General
- What about support for Silverlight 1.0?
- What is the csExWB WebBrowser Control?
- How does Silverlight Spy work?
Issues
- Silverlight Spy won't start or crashes on initialization
- Silverlight Applications don't start, only a load progress of 0% visible
- Error: Cannot start, already installed from another location
- My Silverlight 2 Application is detected as Silverlight 1.0
What about support for Silverlight 1.0?
The current version of Silverlight Spy only supports Silverlight 2 (Beta 2) applications. Support for Silverlight 1.0 applications has been planned. You can still inspect Silverlight 1.0 application with the previous version of Silverlight Spy. A download link is available on the Download page.
What is the csExWB WebBrowser Control?
Silverlight Spy uses a customized WebBrowser control that enables it to intercept HTTP traffic. The customized WebBrowser control (csExWB) requires a COM library to be installed and registered on your machine. csExWB is freeware and developed by MH. You can get more information about the control here.
Developers: if you need complete control over an embedded WebBrowser in your .NET application I strongly recommend csExWB. It's an excellent piece of work.
How does Silverlight Spy work?
Silverlight Spy is one of the few applications where a .NET WinForm interacts heavily with a Silverlight application. The interoperability of .NET 3.5 and Silverlight is achieved by using the Silverlight HTML Bridge (using RegisterScriptableObject and ScriptableMemberAttribute) in combination with window.external (WebBrowser.ObjectForScripting). The interop between a .NET 3.5 WinForm and a Silverlight application is essentially not any different from the interop of JScript and Silverlight. If you can do it in JScript, you can do it .NET as well. There is a bit of COM involved, but it's not that hard to implement.
When an HTML page is loaded in the Silverlight Spy, the Spy starts looking for Silverlight applications using standard HTML DOM operations such as GetElementByTagName. Once a Silverlight application is found, the Spy needs to access the application's characteristics. Since the Spy doesn't know anything about a particular Silverlight application, it needs to inject a small Silverlight bridge which provides all the information about the application. And here is where the csExWB WebBrowser control comes in. Using csExWB, Silverlight Spy intercepts any XAP download and before handing the XAP package over to Silverlight, the Spy adds a small Silverlight library to the XAP package. This library auto-registers a HTML bridge interface containing a number of methods exposing everything the Spy needs to build the XAML explorer and details of all the UI elements available in the running application.
Silverlight Spy won't start or crashes on initialization
You are probably missing the required csExWB WebBrowser control. Make sure you have installed it (see also Silverlight Spy Download). I still need to detect this situation and raise a more user-friendly error. If you do have all prerequisites installed and Silverlight Spy still won't start, please contact me and provide as much information as possible about your current machine configuration (operating system, service packs, processor type (64bit, multi-core,..), etc. etc.
Silverlight Applications don't start, only a load progress of 0% visible
You are using an obsolete version of the csExWB WebBrowser control. Uninstall the WebBrowser control from your OS (in Add/Remove Programs) and download and install the latest version (see also Silverlight Spy Download).
Error: Cannot start, already installed from another location
The following message box appears when trying to run Silverlight Spy:
You cannot start application Silverlight Spy 2 from this location because it is already installed from a different location.
You are trying to to start the application from an incorrect url. The correct ClickOnce application manifest location for Silverlight Spy 2 is http://www.silverlightspy.com/downloads/SilverlightSpy2/FirstFloor.SilverlightSpy.application. Please be aware of the fact that urls are case-sensitive in the ClickOnce world. In previous versions the application used the Downloads folder (with a capital D) which is not correct. If you keep running into this problem, uninstall and reinstall from the above link might help.
My Silverlight 2 Application is detected as Silverlight 1.0
You are probably using an ASP.NET control to generate the Silverlight object. If this is the case, you'll need to change the Version="2.0" attribute to MinimumVersion="2.0.30523". Version="2.0" generates an object of type "application/x-silverlight" which Silverlight Spy detects as Silverlight v1.
Using the MinimumVersion attribute, the type is set to "application-x-silverlight-2-b2", which is the correct type of Silverlight 2 Beta 2 applications. I'm not sure whether this is a bug in the ASP.NET control, but it looks like one. I am in the process of updating the Spy so it is able to handle these incorrect object types. In the meantime you can use this solution.

