Silverlight Surprise

PreEmptive Solutions became a Visual Studio insider (literally) when Microsoft began shipping our Dotfuscator CE code obfuscation module with Visual Studio back in 2003.

PreEmptive Solutions became a Visual Studio insider (literally) when Microsoft began shipping our Dotfuscator CE code obfuscation module with Visual Studio back in 2003. Three Visual Studio launches later, the 2010 release of the IDE is still special for us. It began in early 2008 when we extended Dotfuscator CE beyond preventing reverse engineering of code to include application-usage monitoring in the wild.

Today, every version of Visual Studio 2010 except Express embeds Dotfuscator CE. The new application-monitoring capabilities include the injection of instrumentation, post-compile, into any managed assemblies that stream usage data at runtime to an endpoint for processing and analysis. We call it Runtime Intelligence. Developers can check out the Runtime Intelligence Endpoint Starter kit -- available for download from CodePlex -- to learn how to stream runtime data to any endpoint.

We worked closely with Microsoft to enable these new capabilities under Visual Studio 2010, but even with Redmond's aggressive ecosystem support, it wasn't surprising that we found some gaps. Our work to integrate Runtime Intelligence into Silverlight served as a case in point.

Silverlight sits at the crossroads of a rapidly evolving, heterogeneous computing landscape where developers, designers, end users and a complex network of stakeholders all have a vested interest in knowing their applications are being used. Developers need analytics to work across all of their Microsoft .NET Framework components (not just Silverlight), but designers are looking for Web analytics in line with existing services (not just managed code). ISVs need to include customer opt-in logic, while Web sites do not. In order to be effective, Silverlight instrumentation and analytics have to be broad enough to satisfy this diverse set of stakeholders, yet provide specific optimizations for each surface, development workflow and use case.

Hidden by Design
As part of the Visual Studio launch, the crew of the .NET Rocks! talk show undertook a multi-city, cross-

country roadshow, and published a very cool Silverlight 4/Bing application that would organize tweets and show their location in real time. They chose to inject Runtime Intelligence to show how Visual Studio 2010 instrumentation could be applied. Figure 1 shows a surprise we got when the monitoring results came back. All Silverlight sessions seemed to end prematurely, unique user count was clearly inaccurate and there was no information on the runtime OS.

[Click on image for larger view.]
Figure 1. Runtime Intelligence was missing critical data when tracking Silverlight applications.

Many of you probably already know how this part of the story ended. Silverlight by design does not allow service calls from the Application Exit event; therefore, the final Runtime Intelligence posts were all silently failing. Furthermore, the Silverlight sandbox hid the underlying runtime details used to identify unique users and the underlying OS -- again by design.

To address this behavior, we're updating Dotfuscator to inject logic for Silverlight programs that write to isolated storage, so data saved at application exit is available at the next startup. The next time the instrumented application is fired up, it will check isolated storage for the information from earlier sessions and post it. The instrumentation will also generate an arbitrary value and write it to isolated storage to track unique user sessions.

Filling Gaps
As much as Microsoft works to support ISVs like PreEmptive with detailed documentation, early code previews, and direct access to product engineers and managers, at the end of the day it was up to us to discover -- and ultimately fill -- an unanticipated gap between our product and the Microsoft Silverlight platform. The result benefits everyone. We end up with a more capable service, Microsoft gets better support in Visual Studio for its vital Silverlight platform and developers gain access to vital application runtime data.

About the Author

Sebastian Holst is chief marketing officer at PreEmptive Solutions LLC and served as a member of the W3C Advisory Committee for three years, a board member of IDEAlliance for four years and was a cofounder of the Compliance Consortium.

comments powered by Disqus


Subscribe on YouTube