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


Installing the .NET API

If you haven't already, you can obtain a copy of the latest version of the API using one of the links on the Downloads page.

There are two ways to install the .NET API:

NuGet Package Manager

As of version there are now three separate packages: 51Degrees.mobi-core, 51Degrees.mobi-web and 51Degrees.mobi-data. This allows you to choose whether you want to use the example web page to get you started quickly, or just download the API. This also allows you to update the ‘lite’ data file independently of the API.

Complete the following four steps to set up a new Visual Studio .NET web application with mobile device detection.

Step 1 – Search for 51Degrees in the NuGet package manager.

Step 2 – Select the 51Degrees.mobi-web, 51Degrees.mobi-core and the 51Degrees.mobi-data packages and press Install. NuGet will automatically add the necessary files and references to your project.

Step 3 – You can now use 51Degrees properties with the Request.Browser object using the following example code. An example web page will be available in the Mobile folder of the web site. Access the web site from a mobile device to be redirected to the example web page.

Step 4 – If required reference the FiftyOne.Foundation.dll assembly from within Visual Studio to access the WebProvider.

If you are using MVC pages, instead of the 51Degrees.mobi-web package, install 51Degrees.mobi-WebMatrix, this will install an MVC Razor example web page.

Include the DLL

Copy the DLL from the FoundationV3 directory into your project's bin directory.

Web sites running .NET v4 enable assemblies to register themselves automatically when the web site starts. Therefore they do not need to be referenced in the web.config file. If the detection functionality fails to work it's possible the web site has been configured to prevent the automatic registration of assemblies. If this happens continue to the instructions for .NET 3.5 which explain how to explicitly register the assembly with the web site.