FiftyOne.DeviceDetection 4.5.0-alpha.26

This is a prerelease version of FiftyOne.DeviceDetection.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package FiftyOne.DeviceDetection --version 4.5.0-alpha.26                
NuGet\Install-Package FiftyOne.DeviceDetection -Version 4.5.0-alpha.26                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FiftyOne.DeviceDetection" Version="4.5.0-alpha.26" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FiftyOne.DeviceDetection --version 4.5.0-alpha.26                
#r "nuget: FiftyOne.DeviceDetection, 4.5.0-alpha.26"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install FiftyOne.DeviceDetection as a Cake Addin
#addin nuget:?package=FiftyOne.DeviceDetection&version=4.5.0-alpha.26&prerelease

// Install FiftyOne.DeviceDetection as a Cake Tool
#tool nuget:?package=FiftyOne.DeviceDetection&version=4.5.0-alpha.26&prerelease                

51Degrees Device Detection Engines

51Degrees Pipeline API

Developer Documentation

Introduction

This repository contains the device detection engines for the .NET implementation of the Pipeline API.

The specification is also available on GitHub and is recommended reading if you wish to understand the concepts and design of this API.

Dependencies

Visual Studio 2022 or later is recommended. Although Visual Studio Code can be used for working with most of the projects.

The core device detection projects are written in C and C++. The Pipeline engines are written in C# and target .NET Standard 2.0.3. Example and test projects mostly target .NET 6.0 though in some cases, projects are available targeting other frameworks.

For runtime dependencies, see our dependencies page. The ci/options.json file lists the tested and packaged .NET versions and operating systems automatic tests are performed with. The solution will likely operate with other versions.

Data

The API can either use our cloud service to get its data or it can use a local (on-premise) copy of the data.

Cloud

You will require a resource key to use the Cloud API. You can create resource keys using our configurator, see our documentation on how to use this.

On-Premise

In order to perform device detection on-premise, you will need to use a 51Degrees data file. This repository includes a free, 'lite' file in the 'device-detection-data' sub-module that has a significantly reduced set of properties. To obtain a file with a more complete set of device properties see the 51Degrees website. If you want to use the lite file, you will need to install GitLFS.

On Linux:

sudo apt-get install git-lfs
git lfs install

Then, navigate to 'device-detection-cxx/device-detection-data' and execute:

git lfs pull

Solutions and projects

  • FiftyOne.DeviceDetection - Device detection engines and related projects.
    • FiftyOne.DeviceDetection - Contains device detection engine builders.
    • FiftyOne.DeviceDetection.Cloud - A .NET engine which retrieves device detection results by consuming the 51Degrees cloud service. This can be swapped out with either the hash or pattern engines seamlessly.
    • FiftyOne.DeviceDetection.Hash.Engine.OnPremise - .NET implementation of the device detection hash engine. CMake is used to build the native binaries.
    • FiftyOne.DeviceDetection.Shared - Shared classes used by the device detection engines.

Installation

Nuget

The easiest way to install is to use NuGet to add the reference to the package:

Install-Package FiftyOne.DeviceDetection

Build from Source

Device detection on-premise uses a native binary (i.e. compiled from C code to target a specific platform/architecture). The NuGet package contains several binaries for common platforms. However, in some cases, you'll need to build the native binaries yourself for your target platform. This section explains how to do this.

Pre-requisites
  • Install C build tools:
    • Windows:
      • You will need either Visual Studio 2022 or the C++ Build Tools installed.
        • Minimum platform toolset version is v143
        • Minimum Windows SDK version is 10.0.18362.0
    • Linux/MacOS:
      • sudo apt-get install g++ make libatomic1
  • If you have not already done so, pull the git submodules that contain the native code:
    • git submodule update --init --recursive

Visual studio should now be able to build the native binaries as part of its normal build process.

Packaging

You can package a project into NuGet *.nupkg file by running a command like:

dotnet pack [Project] -o "[PackagesFolder]" /p:PackageVersion=0.0.0 -c [Configuration] /p:Platform=[Architecture]
⚠️ Notes on packaging FiftyOne.DeviceDetection.Hash.Engine.OnPremise

📝 Using AnyCPU might prevent the unmanaged (C++) code from being built into .Native.dll library. Use x86/x64/arm64 specifically.

📝 If creating cross-platform package from multiple native dlls, put all 6x FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Native.dll into respective folders:

../
    macos/
        arm64/
        x64/
    linux/
        x64/
        x86/
    windows/
        x64/
        x86/

and add to the packaging command:

/p:BuiltOnCI=true

related CI scripts:

  • BuiltOnCI var:
    • [https://github.com/51Degrees/common-ci/blob/main/dotnet/build-project-core.ps1]
    • [https://github.com/51Degrees/common-ci/blob/main/dotnet/build-package-nuget.ps1]
    • [https://github.com/51Degrees/common-ci/blob/main/dotnet/build-project-framework.ps1]
    • [https://github.com/51Degrees/device-detection-dotnet/blob/main/ci/run-performance-tests-console.ps1]
  • Copying native binaries:
    • [https://github.com/51Degrees/device-detection-dotnet/blob/main/ci/build-package.ps1]
Strong naming

We currently do not strong name assemblies due to downsides for developers. The main of which is that .NET Framework on Windows enables strict loading of assemblies once an assembly is strong named. A strong-named assembly reference must exactly match the version of the loaded assembly, forcing developers to configure binding redirects when using the assembly.

If it is absolutely critical for your use case to integrate a strong-named assembly - please create a feature request issue.

Examples

Examples can be found in device-detection-dotnet-examples repository.

Tests

Tests can be found in the Tests/ folder. These can all be run from within Visual Studio or by using the dotnet test command line tool.

Some tests require additional resources to run. These will either fail or return an 'inconclusive' result if these resources are not provided.

  • Some tests require an 'Enterprise' data file. This can be obtained by purchasing a license.
    • Once available, the full path to this data file must be specified in the DEVICEDETECTIONDATAFILE environment variable.
  • Tests using the cloud service require resource keys with specific properties to be provided using environment variables:
    • The SUPER_RESOURCE_KEY environment variable should be populated with a key that includes all properties. A license is required in order to access some properties.

Project documentation

For complete documentation on the Pipeline API and associated engines, see the 51Degrees documentation site.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FiftyOne.DeviceDetection:

Package Downloads
Foundation.SitecoreExtensions

Foundation.SitecoreExtensions

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.5.0-alpha.43 39 12/2/2024
4.5.0-alpha.32 54 11/14/2024
4.5.0-alpha.30 47 11/13/2024
4.5.0-alpha.28 42 11/12/2024
4.5.0-alpha.26 44 11/9/2024
4.5.0-alpha.24 37 11/7/2024
4.5.0-alpha.22 33 11/6/2024
4.5.0-alpha.18 41 11/5/2024
4.5.0-alpha.14 75 10/15/2024
4.5.0-alpha.12 41 10/14/2024
4.5.0-alpha.11 41 10/13/2024
4.5.0-alpha.9 52 10/10/2024
4.4.200 57 12/11/2024
4.4.199 73 12/10/2024
4.4.198 338 12/3/2024
4.4.197 168 12/2/2024
4.4.196 116 12/1/2024
4.4.195 221 11/27/2024
4.4.194 551 11/14/2024
4.4.193 116 11/13/2024
4.4.192 127 11/12/2024
4.4.191 261 11/9/2024
4.4.190 176 11/6/2024
4.4.189 176 11/5/2024
4.4.188 134 11/3/2024
4.4.187 138 11/2/2024
4.4.186 358 10/23/2024
4.4.185 115 10/22/2024
4.4.184 538 10/18/2024
4.4.183 177 10/17/2024
4.4.182 919 10/10/2024
4.4.181 177 10/8/2024
4.4.180 224 10/4/2024
4.4.179 476 10/2/2024
4.4.178 161 10/1/2024
4.4.177 514 9/30/2024
4.4.176 168 9/28/2024
4.4.175 775 9/13/2024
4.4.174 204 9/10/2024
4.4.173 157 9/8/2024
4.4.172 139 9/7/2024
4.4.171 165 9/5/2024
4.4.170 143 9/4/2024
4.4.169 150 9/3/2024
4.4.168 206 8/30/2024
4.4.167 135 8/29/2024
4.4.166 493 8/20/2024
4.4.165 282 8/15/2024
4.4.164 145 8/14/2024
4.4.163 244 8/13/2024
4.4.162 986 8/7/2024
4.4.161 431 8/6/2024
4.4.160 107 8/5/2024
4.4.159 95 8/3/2024
4.4.158 125 7/30/2024
4.4.157 170 7/26/2024
4.4.156 72 7/26/2024
4.4.155 194 7/24/2024
4.4.154 528 7/19/2024
4.4.153 147 7/18/2024
4.4.152 136 7/17/2024
4.4.151 138 7/16/2024
4.4.150 125 7/15/2024
4.4.149 232 7/11/2024
4.4.148 158 7/10/2024
4.4.147 147 7/9/2024
4.4.146 173 7/7/2024
4.4.145 218 7/4/2024
4.4.144 378 6/27/2024
4.4.143 165 6/25/2024
4.4.142 730 6/19/2024
4.4.141 167 6/19/2024
4.4.140 220 6/15/2024
4.4.139 205 6/11/2024
4.4.138 802 6/1/2024
4.4.137 159 5/31/2024
4.4.136 206 5/29/2024
4.4.135 121 5/29/2024
4.4.134 1,118 5/25/2024
4.4.133 228 5/22/2024
4.4.132 234 5/18/2024
4.4.131 126 5/17/2024
4.4.130 132 5/16/2024
4.4.129 94 5/16/2024
4.4.128 120 5/15/2024
4.4.127 111 5/15/2024
4.4.126 179 5/14/2024
4.4.125 479 5/13/2024
4.4.124 208 5/12/2024
4.4.123 112 5/12/2024
4.4.122 285 5/8/2024
4.4.121 287 5/3/2024
4.4.120 80 5/2/2024
4.4.119 164 4/30/2024
4.4.118 315 4/28/2024
4.4.117 206 4/25/2024
4.4.116 253 4/23/2024
4.4.115 210 4/21/2024
4.4.114 188 4/20/2024
4.4.113 5,341 4/10/2024
4.4.112 160 4/4/2024
4.4.111 535 3/27/2024
4.4.110 1,315 3/21/2024
4.4.109 180 3/21/2024
4.4.108 233 3/19/2024
4.4.107 187 3/18/2024
4.4.106 182 3/17/2024
4.4.105 173 3/16/2024
4.4.104 1,065 2/22/2024
4.4.103 264 2/21/2024
4.4.102 330 2/16/2024
4.4.101 260 2/15/2024
4.4.100 284 2/14/2024
4.4.99 243 2/14/2024
4.4.98 551 2/2/2024
4.4.97 287 2/1/2024
4.4.96 2,173 1/28/2024
4.4.95 255 1/27/2024
4.4.94 276 1/26/2024
4.4.93 671 1/18/2024
4.4.92 297 1/16/2024
4.4.91 308 1/14/2024
4.4.90 289 1/13/2024
4.4.89 264 1/12/2024
4.4.88 285 1/11/2024
4.4.87 267 1/10/2024
4.4.86 386 1/7/2024
4.4.85 1,089 12/21/2023
4.4.84 281 12/19/2023
4.4.83 516 12/8/2023
4.4.82 361 12/3/2023
4.4.81 304 12/1/2023
4.4.80 295 11/30/2023
4.4.79 312 11/29/2023
4.4.78 319 11/26/2023
4.4.77 279 11/25/2023
4.4.76 312 11/24/2023
4.4.75 299 11/23/2023
4.4.74 319 11/21/2023
4.4.73 542 11/4/2023
4.4.72 265 11/3/2023
4.4.71 287 11/2/2023
4.4.70 256 11/1/2023
4.4.69 377 10/29/2023
4.4.68 290 10/28/2023
4.4.67 277 10/27/2023
4.4.66 290 10/26/2023
4.4.65 324 10/25/2023
4.4.64 1,838 10/12/2023
4.4.63 427 10/6/2023
4.4.62 828 9/24/2023
4.4.61 347 9/21/2023
4.4.60 267 9/21/2023
4.4.59 503 9/17/2023
4.4.58 283 9/16/2023
4.4.57 307 9/15/2023
4.4.56 313 9/14/2023
4.4.55 311 9/13/2023
4.4.54 413 9/11/2023
4.4.53 304 9/10/2023
4.4.52 290 9/9/2023
4.4.51 367 9/6/2023
4.4.50 350 9/3/2023
4.4.49 329 9/1/2023
4.4.48 366 8/31/2023
4.4.47 559 8/18/2023
4.4.46 462 8/11/2023
4.4.45 359 8/10/2023
4.4.44 323 8/8/2023
4.4.43 7,148 7/22/2023
4.4.42 355 7/20/2023
4.4.41 351 7/17/2023
4.4.40 302 7/15/2023
4.4.39 358 7/13/2023
4.4.38 406 7/9/2023
4.4.37 365 7/6/2023
4.4.36 343 7/4/2023
4.4.35 409 6/28/2023
4.4.34 329 6/27/2023
4.4.33 1,124 6/24/2023
4.4.32 810 6/22/2023
4.4.31 1,171 6/21/2023
4.4.30 358 6/20/2023
4.4.29 413 6/15/2023
4.4.28 339 6/14/2023
4.4.27 368 6/12/2023
4.4.26 352 6/10/2023
4.4.25 436 6/8/2023
4.4.24 2,532 6/5/2023
4.4.23 18,180 3/24/2023
4.4.22 1,713 3/20/2023
4.4.21 614 3/15/2023
4.4.20 458 3/10/2023
4.4.19 634 3/6/2023
4.4.17 3,515 2/15/2023
4.4.16 4,675 2/1/2023
4.4.15 740 1/18/2023
4.4.14 1,521 12/8/2022
4.4.13 1,332 12/7/2022
4.4.12 1,973 11/2/2022
4.4.11 787 8/30/2022
4.4.10 1,751 8/10/2022
4.4.9 871 7/27/2022
4.4.8 228,475 6/29/2022
4.4.7 630 6/22/2022
4.4.6 598 6/15/2022
4.4.5 593 5/25/2022
4.4.3 850 5/4/2022
4.4.2 593 4/27/2022
4.4.1 606 4/20/2022
4.4.0 638 4/7/2022
4.3.17 1,331 3/31/2022 4.3.17 is deprecated because it is no longer maintained.
4.3.16 1,323 3/2/2022 4.3.16 is deprecated because it is no longer maintained.
4.3.15 3,082 2/2/2022 4.3.15 is deprecated because it is no longer maintained.
4.3.14 925 1/25/2022 4.3.14 is deprecated because it is no longer maintained.
4.3.13 14,206 12/22/2021 4.3.13 is deprecated because it is no longer maintained.
4.3.12 622 12/15/2021 4.3.12 is deprecated because it is no longer maintained.
4.3.11 591 12/1/2021 4.3.11 is deprecated because it is no longer maintained.
4.3.10 597 11/17/2021 4.3.10 is deprecated because it is no longer maintained.
4.3.9 983 11/3/2021 4.3.9 is deprecated because it is no longer maintained.
4.3.8 726 10/6/2021 4.3.8 is deprecated because it is no longer maintained.
4.3.6 882 9/15/2021 4.3.6 is deprecated because it is no longer maintained.
4.3.5 195 9/1/2021 4.3.5 is deprecated because it is no longer maintained.
4.3.4 697 8/17/2021 4.3.4 is deprecated because it is no longer maintained.
4.3.3 232 8/3/2021 4.3.3 is deprecated because it is no longer maintained.
4.3.0 538 6/16/2021 4.3.0 is deprecated because it is no longer maintained.
4.2.4 2,403 5/11/2021 4.2.4 is deprecated because it is no longer maintained.
4.2.1 1,614 2/3/2021 4.2.1 is deprecated because it is no longer maintained.
4.2.0 732 1/6/2021 4.2.0 is deprecated because it is no longer maintained.
4.1.10 1,776 8/10/2020 4.1.10 is deprecated because it is no longer maintained.
4.1.8 337 7/13/2020 4.1.8 is deprecated because it is no longer maintained.
4.1.7 569 6/30/2020 4.1.7 is deprecated because it is no longer maintained.
4.1.6 1,944 5/29/2020 4.1.6 is deprecated because it is no longer maintained.
4.1.0-beta.26 315 2/18/2020 4.1.0-beta.26 is deprecated because it is no longer maintained.
4.1.0-beta.25 240 2/13/2020 4.1.0-beta.25 is deprecated because it is no longer maintained.
4.1.0-beta.22 298 1/17/2020 4.1.0-beta.22 is deprecated because it is no longer maintained.
4.1.0-beta.19 285 1/7/2020 4.1.0-beta.19 is deprecated because it is no longer maintained.
4.1.0-beta.18 299 1/7/2020 4.1.0-beta.18 is deprecated because it is no longer maintained.