Archive for the ‘Dotfuscator CE’ Category

PreEmptive is doing its part to help the Vancouver Winter Olympics go off smoothly.

Friday, February 19th, 2010 by Gabriel Torok

Online viewers of the Vancouver Olympics on NBCOlympics.com are using Silverlight based video and photo viewers delivering full HD quality content for viewers and helping content owners monetize their content. I am pleased to say that Dotfuscator had a hand in all of this innovation providing both protection and optimization for the high performing video player at the heart the NBC online Olympic experience.

For an overall description of the Silverlight solution, see: http://team.silverlight.net/events/let-the-games-begin/

For Microsoft’s own description of the role of partners (including us of course), see: http://team.silverlight.net/customer-evidence/vancouver-olympics-ndash-how-rsquo-d-we-do-that/

The development teams especially appreciated the fact that Dotfuscator can accept and output XAP files (instead of low level DLLs that force developers to manually edit XAP files).  This shortens and simplifies the release process – and was critical for an event like the Olympics.

On an unrelated Silverlight note, I was pleased to see David Kelly’s recent blog entry . This Silverlight MVP has identified Dotfuscator’s Silverlight analytics as “a critical tool in your tool Silverlight toolbox.” Good Stuff.

Cheap CEIP

Monday, February 8th, 2010 by Joe Kuemerle

Spring is (hopefully) just around the corner here in the northern hemisphere, with warming weather a young man’s fancy turns to that age old question…"what exactly are my users doing with my application?"

We’re familiar with big software vendors including Customer Experience Improvement Program (CEIP) features in their applications allowing them to gather anonymous usage data showing which features people are actually using. Analyzing that data allows them to focus their development efforts on what their users are actually doing, as well as obtaining hard measurements of how features are actually adopted in the wild. As someone whose paycheck depends on meeting the users’ requirements I really like to know how much of my time is being spent developing stuff that people actually want and use. Unfortunately, I don’t have the huge number of person-years and dollars to spend on something that is not directly related to my core application functionality to get a CEIP into my products.

CEIP Dialogs

Instrumenting an application to send its usage data back to the free Runtime Intelligence portal hosted by PreEmptive is covered in some previous blog posts (here and here ), but today I am covering a slightly different scenario. While there are great analytics capabilities in the hosted portal, my current needs are only basic usage tracking and that I must store the data at my own facility. As is normally the case in proof-of-concept situations, I have no budget, no time, and am highly visible to non-technical decision makers.

The first problem, no budget, is easily solved by using freely available tools. First, I am going to use Dotfuscator Community Edition 5.0, included in my copy of Visual Studio 2010, to perform injection of the application analytics functionality into my binaries. Since I need to store the usage data at my location I can’t use the hosted free endpoint and reporting portal, but I can use the new open source (Ms-RL license) Runtime Intelligence Endpoint Starter Kit (RI Starter Kit) to build my own application usage listener service, data repository, and basic reports.

Instrumentation via extended attributes in Dotfuscator UI

The fact that I have no time to implement this is also solved by my selection of tools. Since this is a proof-of-concept, I don’t need to create any extra code to obtain the users opt-in consent for tracking application usage. This means I can leverage Dotfuscator’s post compilation code injection model, similar to IL Weaving in Aspect Orientated Programming, to inject usage tracking directly into my test application binary without changing any source code or recompiling. In a matter of minutes I navigate through my applications structure and define the injection points from within the Dotfuscator user interface. To create a database using either SQL Express 2005 or higher or MySQL 5 or higher only takes a few minutes. Finally, setting up the WCF service project only requires updating the connection string in the web.config. Using the outstanding documentation included in the RI Starter Kit as my guide in less than an 30 minutes I have a proof of concept for tracking how often my application is run and which features the users are actually using.

Application analytics feature use report

Finally, I have to show something useful to the non-technical users. I know that application analytics data is being sent to my endpoint and stored in the database. I can easily run a few queries to get a feel for how the application is being used but not everyone is as comfortable with SQL as I am. As I review the source code included in the RI Starter Kit I see that there is also a SQL Server Reporting Services solution that contains two prewritten reports that show application and feature usage over time. A quick update of the data source, a deploy to the SSRS server, and now the business users have an easy way of seeing what our users like best about our products. To add application analytics data to executive dashboards, there’s also a SharePoint Web Part included so you can easily put an application usage graph directly into any SharePoint site (WSS 3.0 / MOSS 2007 or higher).

Application analytics SharePoint dashboard

All in all, I have spent around an hour and no money adding basic application usage tracking and analysis to an existing product and exposed that data to both technical and non-technical users. With only a small amount of code, I easily add an opt-in dialog to my product so my users can choose to send their usage data for analysis.  Now I have the start of my very own Customer Experience Improvement Program.

PreEmptive is always looking for feedback on our products, please take this new solution for a spin and leave us comments, feature requests and ideas on the project’s Codeplex page.

How do I love thee? Let me count the ways.

Thursday, August 20th, 2009 by Sebastian Holst

“How do I love thee? Let me count the ways. I love thee to the depth and breadth and height” - Sonnet 43, Elizabeth Barrett Browning

So “what’s love got to do with it?” (Private Dancer, Tina Turner) Hint: if people live for love, then businesses live for money

On July 14th, Microsoft announced Azure pricing and a “grace period” through PDC 2009. A primary rationale here is to enable development organizations to optimize deployment and monetization models to maximize Azure commercial opportunities.

So, whether you are a romantic (like Ms Browning above) or perhaps more hardened like Tina Turner’s Private Dancer (or Stanley Kubrick a la Full Metal Jacket), one thing is for sure - Microsoft wants Azure to “love you long time.” How deep, wide, high or long is the question.

Check out a this article in SD Times - PreEmptive’s Dotfuscator instruments Azure applications By David Worthington – where Dave Worthington makes many of the very same points.

Of course, we announced Runtime Intelligence Service (RIS) Azure support to help developers answer these very questions. While perhaps not as soaring as a sonnet – Runtime Intelligence allows for any .NET component deployed into Azure to be injected (post-build) with session, feature and method level monitoring. The runtime intelligence is streamed out of Azure for analysis. Other than writing a custom solution, this is perhaps the only means to measure adoption, usage patterns and performance inside Azure in near real-time.

Now, my posts are all intended to help you (blog followers) find more ways to make more money (we want to spread the love). So, you will note that I very specifically said the RIS helps to answer these questions. What the Azure development community really needs is an ROI calculator that will combine real usage data (from both legacy and piloted Azure applications) with Microsoft pricing and the offset IT expenses to come up with an Azure ROI calculator. I know there are lots of calculators being written – but how many of them can incorporate actual usage data before and after deployment to the cloud? That’s not our business – but could it be yours?

If yes, let me know and I will make sure you have what you need to call our RI Service via our RESTful API – making your calculator uniquely able to reliably predict cloud ROI.

As always, i have a more philosophical take on this issue on my personal blog at http://apps-are-people-too.blogspot.com/2009/08/how-do-i-love-thee-let-me-count-ways.html

Correlating Downloads to Usage With Visual Studio 2010

Wednesday, June 24th, 2009 by Joe Kuemerle

Introduction

This is the second article in my ongoing series on how to use the new, free features available in Dotfuscator Software Services Community Edition in Visual Studio 2010.  In addition to obfuscation, it allows you to track how users are using your applications; and, it can inject additional functionality such as tamper detection and application expiration.  For an introduction to Runtime Intelligence and an overview of the new features included in Dotfuscator CE, see the introductory article in this series What Is Runtime Intelligence .  I also recommend that you read the What’s New with Dotfuscator in Visual Studio 2010 Beta 1 post, a walkthrough that demonstrates some of the same new Dotfuscator CE features I will be using here.

For this example we will be using the Witty Twitter application as our sample application.  This is an open source WPF Twitter client and is available here .

Our current problem as the developer of a Windows client application is once the end user has downloaded our software we have no way of knowing if they actually installed it, much less used it.  There are a number of ways that I have seen people try to track the ratio of installations to downloads, including opening a special web page as part of the installation routine and using web analytics data to infer installations.  There is a similar issue with usage.  You don’t know if anyone started the application, unless it crashes spectacularly, and then you only hear from the three irate users and not the millions of satisfied users.

By using the new Runtime Intelligence capabilities in Dotfuscator CE you can quickly and easily determine how many people actually install and run your application.  You can gather additional details such as which operating systems and CLR versions they are using.  Since Dotfuscator CE can do this through post compilation code injection you don’t need to modify your source code to add these new capabilities to your application.

To accomplish all of this I will be using the publicly available Visual Studio 2010 Beta 1.  As long as you choose to install Dotfuscator and the Windows SDK you will have all of the tools you will need.

Implementation Without Source Code Modification

This article shows how you can add application analytics to an existing application without modifying the source code.  The first step is to download the latest Witty Twitter installer and install it.

Next, copy all of the files from the Witty installation directory to a temporary location to use as a working directory.  This is necessary because the Witty executable has dependencies on other assemblies that are installed with it and Dotfuscator will look in the input directory by default to resolve dependencies.  This also allows us to compare our final performance and functionality to the original.

Now that we have the application files in a new working folder, start Visual Studio 2010.  From the Visual Studio Tools menu select Dotfuscator Software Services.  When Dotfuscator starts up, accept the license agreement and then you will be in Dotfuscator CE’s new WPF user interface.

Now, add the input assembly you want to instrument.  Right click on the Project node of the left hand menu (titled “Dotfuscator1”) and select “Add Assemblies”.  Navigate to your working directory and select the Witty.exe file.

DotfuscatorAddAssembly

By default, Dotfuscator will harden your application by obfuscating it and renaming all possible items within your assembly. For this demonstration you don’t need renaming, so turn it off by selecting the Renaming menu node, right clicking on it, and unchecking the Enable option.  Next, enable instrumentation: navigate to the Instrumentation node; select the Options tab; check the Enable Instrumentation checkbox; then check the “Send application analytics messages” checkbox.  This tells Dotfuscator to inject the analytics instrumentation into your application.

DotfuscatorTurnOnRuntimeIntelligence

Instrumentation Step 1 – Required Assembly Attributes

All instrumented assemblies must have identifying data embedded in them so that it is accessible at runtime.  This data is included in every message and is used to identify the application, its owner, and its components for reporting purposes.  Additionally, you must identify the points in your application where usage tracking is going to be injected.  Both can be done either by using custom attributes to decorate your assembly and methods, or by using Dotfuscator’s Extended Attributes (where the configuration information is stored in the Dotfuscator project file for use during the Dotfuscation process).  For this exercise we are not modifying the application’s source code; therefore we will use Extended Attributes exclusively.

You add the required identifying data using assembly attributes as described in the Configuring Feature Analytics section of the “What’s New With Dotfuscator in Visual Studio 2010 Beta 1” post.  You will need to add both a BusinessAttribute and an ApplicationAttribute to the project with the appropriate CompanyKey and ApplicationKey values.

Instrumentation Step 2 – Tracking Application Usage

The final step is to tell the code injection engine in Dotfuscator where to inject the tracking logic.  Runtime Intelligence is designed to track usage within an application session, so it records both the start up of an application and its successful exit.  This allows you to track the actual usage of your application and to gather information on how often your application terminates unexpectedly.  There are two injection points that need to be defined: the application start up and application shutdown methods.  This is accomplished by adding the Setup and Teardown attributes as described in the Configuring Feature Analytics section of the “What’s New With Dotfuscator in Visual Studio 2010 Beta 1” post.

The Main method of the App class in the Witty Twitter application is the logical place for the startup.  In Dotfuscator CE’s Instrumentation treeview, navigate to the Main method on the Witty.App class.  Right click on the Main method and select Add Attribute.  Select the SetupAttribute.  Leave all of the SetupAttribute’s properties at their default values.

SetupAttribute

Finally, the normal exit point of the application needs to be specified so that code to implement a clean shutdown can be injected into the correct location.  Having a shutdown process provides a dual benefit: first, it ensures that all cached usage data is flushed from the in-memory buffer; second, it sends a closing message to the data collection portal so that this run of the application can be correctly tagged that it completed normally and did not shut down unexpectedly.  The best place to perform shutdown is in the last possible method in the execution flow, where you are certain that the user intends to exit the application.  For Witty, this is the OnClosed method in the MainWindow class.  To add the Teardown attribute, right click on the OnClosed method of the MainWindow class, select Add Attribute, and choose the TeardownAttribute.

TeardownAttribute

These two steps are all that is required to alter an existing application to report on its usage live from the field.  To finish, save the Dotfuscator project, then click on the Build icon to start a build.  By reviewing the build output pane, you can see that your application had both an analytics setup and analytics teardown injected into it and that renaming was disabled.

BuildOutput

By default, Dotfuscator saves the assemblies it outputs into a subdirectory named “Dotfuscated” below the project file.  Navigate to that directory and you will see a new Witty.exe file that has the same functionality as the original, but also reports its usage back to the Free Runtime Intelligence portal.  Now, back up the original Witty.exe in the Witty Program Files folder and copy the version from the Dotfuscated folder to the Witty Program Files folder and run the program.

Whenever the modified Witty starts up, it will send an application start message to the Free Runtime Intelligence Portal.  When you exit the application, it will send an application shutdown message, indicating that the application terminated normally.

Reviewing Accumulated Usage Data

To review your application’s usage, navigate to the free Runtime Intelligence Reporting Portal at http://free.runtimintelligence.com .  Navigate to the Login page and enter the CompanyKey value that you created as part of the BusinessAttribute above.  As the free portal service does not provide any authentication or privacy guarantees, any data that is sent to it should be considered publicly accessible although not publically visible by default.

As Runtime Intelligence is an analytics and trending solution, usage data is not immediately available in the reports.  There will be a delay before data from an application run is aggregated into the reports.

High Level Graphical Analysis

The first usage report we will look at is the “Application Dashboard” report.  This is a high level graphical overview of how often your applications ran.  In this example we can see that for the default reporting period (the past 30 days) we had a total of 10 application runs.  The Witty Twitter application accounted for 60% of that activity with the remaining 40% being the MedicalImage application.  The number in parentheses shows the number of incomplete application runs (those whose startup message was received but the method instrumented with the teardown code was never executed).  From this, we can infer that up to 10% of the time our users may have experienced an application failure with our MedicalImage application.  This is an indicator of possible application instability not a definitive measurement.  There may be an additional exit point in our application that we did not notice, the user may have completely disconnected their computer from the network while running the application, or any number of other issues could have prevented the portal from receiving the teardown message.

ApplicationRuns IncompleteAppRuns

The “Incomplete App Runs” chart gives a representation of how stable applications are overall and in relation to each other.  In this case we can visibly compare the stability of our applications.

The next chart is “Application Usage Over Time”.  This chart tracks the frequency of our applications usage, incomplete sessions and tampers over time.  It provides immediate feedback, allowing us to see if incomplete application sessions are trending higher or lower as we release new versions and how often our application binaries are tampered with in the wild.

ApplicationUsageOverTime

In addition to the usage data, we can see an overview of which operating systems and framework versions our applications are running under.  We can also see the percentage of application sessions that are unstable under particular operating systems or frameworks.

AppRunsByOSAndFramework

High Level Tabular Analysis

Another usage report, the “Application Scorecard” provides a more detailed tabular view of application usage.  Usage reporting is broken down by application unique identifier and application version.  Application usage (including incomplete and tampered instances) is broken down by the application’s unique identifier and version.   From this you can see the most used version of the operating system and framework per application version.  In the commercial version of Runtime Intelligence, you have the ability to uniquely identity each running instance of your application with a serial number.  This report will then summarize how many unique serial numbers were run and the total number of unique users.

ApplicationScorecard

The commercial version of Runtime Intelligence includes an additional report “Usage By Serial Number” - the free portal provides a sample.

By default, the data shown in the application reports consists of the total usage for all applications with the same CompanyKey with activity in the last month.  To change the report parameters, expand the parameter toolbar at the top of the report.  For all reports you can change the date range.  In the application reports you can also filter by an individual application or a specific version of an application, as well as specific operating system and framework versions.  Once you select the criteria for a new filter condition, click the “Refresh” button to display the filtered report.

Measuring Application Usage and Adoption

The number of unique users in the “Application Scorecard” report is a good indicator of how many unique users ran a particular version of your application.  You can compare this value with measurements of how many downloads of a given version occurred and infer an adoption ratio for your application.  This data is an excellent indicator of the adoption rates of your applications.  If your usage numbers are high but the number of users is low then you can infer that your application is both useful and being used but may not be visible enough in the marketplace.  If you have a high number of users but low average usage you may want to consider discoverability or documentation improvements as many of your users may be frustrated and giving up on using the application.

In addition, by examining the “Application Usage Over Time” section of the “Application Dashboard” and setting the filter to different versions of your application, you can visualize the upgrade pattern of your applications as you watch the usage numbers of older versions decline over time, to be replaced with higher usage of newer versions.

By examining the operating system and framework measurements, you can determine how rapidly your users upgrade their platforms.  This visibility can help you plan support for new technologies.  You can also refine your testing to ensure that your test environments match those of your users.

Usage information can be used to determine support lifecycles.  You can back up your supported versions policies with hard data of how often older versions of your software are used.  This information can also be used to measure the success of marketing efforts by providing measurements of how (or if) various campaigns resulted in higher usage of your applications.

Conclusion And Next Steps

In this post we have taken an application and added significant value by giving the application creator the ability to track actual real world usage in near real time.  We have enabled trend analysis over multiple releases of the application to measure upgrade adoption.  In addition, having hard data on usage patterns and runtime environments is invaluable when analyzing where to focus your development and testing time.

In future posts I will show how to perform more in-depth application tracking, how to protect your application binaries from tampering, and how to inject custom expiration behavior into your applications.

How to sell to over one million .NET developers with VS 2010 and VSTS 2010

Monday, June 15th, 2009 by Sebastian Holst

Roughly 15% of all Visual Studio developers have used Dotfuscator Community Edition (CE) to prevent reverse engineering (and I think we can all agree that this is a relatively specialized requirement). If you accept the next uncontroversial assumption that more developers would want to know who is using their software, how and why than would be concerned about reverse engineering – then we can also assume that the new Dotfuscator CE that includes application monitoring capabilities will be adopted by perhaps 2X or even 3X more developers – or between 30% to 45% if the 6 million+ Visual Studio users.

This next series of posts will outline specific opportunities for entrepreneurial developers to build solutions targeting the millions of .NET developers likely be using these new capabilities as VS2010 reaches general availability.  For an earlier example of this, see my blog entry how to make $5 from every .NET developer on the planet.

Post 1 – Code coverage!? I got your code coverage right here pal!

If you think development teams would benefit from being able to readily reconcile testing code coverage results with beta usage code coverage to improve quality and reduce development costs – read on…

With VS2010 Dotfuscator CE feature tracking, you can stream back feature usage during a beta release that can provide a complete picture of what methods were called, in what order and on what technology stack. If only there were an easy way to not only visualize this in the context of the application’s code base but also to overlay this information on earlier testing code coverage results to ensure I have tested what is being used and my beta users are using what I think needs to be tested! That might be an opportunity…

We’ve got an “opp” for that! (apologies to the iPhone ad guys). If you have evaluated VS Beta 1, you may have already noticed that VSTS 2010 Architecture is a completely new release which leaves behind the current Distributed System Designer and the underlying System Definition Model (SDM ) and replaces them with the Unified Modeling Language (UML), Domain Specific Languages (DSLs) and other tools that are not related to UML. The specific tool I want to point to here is the Architecture Explorer (AE).  AE visualizes relationships inside code using the Directed Graph Markup Language (DGML). By extending the DGML, one can use the Architecture Explorer to create visual models of assemblies – post-build – combining both the relationships inside the code (this comes with AE out of the box) and testing and usage coverage results by extending the styles already included in AE. In short, The Architect Explorer with its DGML support and the ability to extend/modify styles offers an ideal means to quickly reconcile usage data with testing code coverage (and platform and framework coverage as well).

This screen shot shows a generic rendering inside the VSTS Architecture Explorer. The rendering is entirely driven through XML data and, as such, can be easily extended to provide specialized views that are relevant across the entire lifecycle of an application.

In this case, the color schemes (or fonts or sizes) can be driven by:

The level of testing completed as reflected inside a TFS repository to quickly answer the questions

  • Testing status – how much testing has been completed?
  • Testing the right things – are there components that should be getting more (or less) attention?

The level of usage by beta test users as reported via the instrumentation capabilities included in Visual Studio 2010 Dotfuscator CE to quickly answer the questions

  • Beta adoption sufficient – have enough users actually run the software through its paces?
  • Critical path coverage – are the new components being exercised as expected?
  • Testing coverage map to usage profile – combining both testing data and usage coverage data can identify areas of code that are not being tested sufficiently given the patterns of usage that are being observed? (mash up)
  • Platform/framework coverage – are enough users evaluating on Vista SP1 or .NET 1.1 or …?
  • What exceptions have been detected that have not been reported through other channels?