Frequently Asked Questions
General
- What about support for Silverlight 1.0?
- What is the csExWB WebBrowser Control?
- How does Silverlight Spy work?
Issues
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.
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) relies on a registration-free COM library that is installed automatically using ClickOnce. 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. csExWB is actively supported by MH and he does so in an extremely fast and adequate manner. Not a single question or comment has been ignored and I did ask a lot!
How does Silverlight Spy work?
Silverlight Spy is an application 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.
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.

