• About Us
  • Blog
  • Basket
  • Account
  • Sign In


Automatic Data Updates

Automatic data updates pulls the latest 51Degrees device data from our servers and updates your local data file.

Using Automatic Updates

The Detector has the capability to automatically receive regular updates of the Device Data when provided with a licence key. The key can either be set by creating a .lic file and adding it to the bin folder of the application (Option 1) or can be compiled into the Foundation dll file (Option 2) by modifying the source code. Your websites configuration also needs to be changed to ensure a Premium data file is being used.

If you don't have a licence key for Device Data you can purchase one here. A key will then be emailed to you immediately on receipt of payment. To check out the benefits of Premium and Enterprise solutions and to compare features visit the Compare Device Data Options page.

Confirming the binaryFilePath

The location and name of the Premium Data file is set in web.config or 51Degrees.config. To set a location for the data, insert the following line into the fiftyOne element of your config (a commented version of this line may already be in the config).

<detection binaryFilePath="~/App_Data/51Degrees.dat"/>

If this file does not exist, the data file is corrupted, in compressed format or the current identity can't read it the Detector will fall back to the embedded Lite Data. If you have a licence key the Detector will attempt to download a Premium Data file into the specified file path. We recommend using the App_Data folder, as the download will fail if the application pool's identity doesn't have read/write permissions.

Note: The detection element must be uncommented and configured correctly for Premium data to work irrespective of the method used to configure automatic updates.

Setting Automatic Updates

To make use of automatic updates your licence key can be placed into the Detector with either of the following methods. Alternatively, if you do not wish to use automatic updates you can download Premium Device Data from here manually (you will need your licence key to proceed but it does not need to be added to the deployment).

Option 1. Using a .lic file

To use a .lic file navigate to your web apps bin folder and create a file with any name with the '.lic' file extension (the file should be in the same folder as the Foundation dll). Open this file with a text editor and copy your key into it. This is the simplest method of enabling automatic updates.

Option 2. Embedding into the source

We recommend you add the key this way if you're planning to distribute premium data with the Detector. To add a key you will need to download the source from Codeplex. You can then find the required constants in 'FiftyOne.Foundation/Properties/DetectionConstants.cs'. You should see this line code:

private const string PREMIUM_DATA_KEY = "";

You should change the value from null to your licence key. After recompiling the Detector will now automatically download device data updates weekly.

Confirming Data Updates

The log file will record when a new update has been download and installed with 'info' level messages. Any failures are also recorded. By default, data checks are performed within a minute of starting, and then every 6 hours once the current data publish data is older than 6 days old.

If new data is failing to load first check the log file. If it hasn't been written it is most likely that the App Pool does not have write permissions. See this guide from BlueValleyTech if you're unsure how to change this or check out a stackoverflow thread on giving write permissions for specific user. Other common problems are the licence key either hasn't been found or is not valid and that firewall permissions may also be needed for https://51Degrees.com. These should be reported in the log file.