> For the complete documentation index, see [llms.txt](https://doc.faceplugin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.faceplugin.com/products/face-recognition-sdk/recognition-and-liveness/recognition-and-liveness-server/face-recognition-dot-net-sdk.md).

# .NET

Faceplugin Face Recognition .NET SDK. Fully on-premise face matching and liveness for C# and .NET. Activate, Init, DetectFace, Compare.

### Code <a href="#setup" id="setup"></a>

{% embed url="<https://github.com/Faceplugin-ltd/FaceRecognition-.Net>" %}

### Setup <a href="#setup" id="setup"></a>

1. Copy`FacepluginSDK.dll` to your project.
2. Include `FaceSDK.cs` to your project.

### APIs

#### <mark style="color:orange;">GetHardwareId:</mark> This API is used to get hardware id of the device on which this SDK is running on <a href="#setactivation" id="setactivation"></a>

```csharp
public String GetHardwareId()
```

#### <mark style="color:orange;">Activate:</mark> This API is used to activate the SDK <a href="#setactivation" id="setactivation"></a>

```csharp
public int Activate(String license)
```

#### <mark style="color:orange;">Init:</mark> This API is used to initialize the SDK call these functions <a href="#setactivation" id="setactivation"></a>

```csharp
public int Init(string modelPath)
```

#### <mark style="color:orange;">DetectFace:</mark> This API is used to detect faces, face liveness and get face attributes including yaw, roll, pitch, eye closedness, face occlusion, call these functions <a href="#similaritycalculation" id="similaritycalculation"></a>

```csharp
public int DetectFace(byte[] rgbData, int width, int height, int stride, [In, Out] ResultBox[] faceBoxes, int faceBoxCount)
```

#### <mark style="color:orange;">Compare:</mark> This API is used to get the similarity of two face images <a href="#similaritycalculation" id="similaritycalculation"></a>

```csharp
public int Compare(byte[] rgbData1, int width1, int height1, int stride1, byte[] rgbData2, int width2, int height2, int stride2, [In, Out] float[] similarity)
```

#### &#x20;<a href="#similaritycalculation" id="similaritycalculation"></a>

{% hint style="info" %}
This page follows the public [FaceRecognition-.Net](https://github.com/Faceplugin-ltd/FaceRecognition-.Net) API (`GetHardwareId`, `Activate`, `Init`, `DetectFace`, `Compare`). If your DLL exposes different method names, [contact us](/help/request-a-license-and-support.md) with the methods you see.
{% endhint %}

[Request a License & Support](/help/request-a-license-and-support.md) · [Contact us](/help/contact-us.md)

### FAQ

**What APIs does this page ship?** Public GitHub names: `GetHardwareId`, `Activate`, `Init`, `DetectFace`, `Compare`.

**Is this the Windows HTTP API?** No. For `POST /api/detect` on port **8083**, use [Face Recognition Windows SDK](/products/face-recognition-sdk/recognition/server-sdk/face-recognition-windows-sdk.md).

### Related documentation

* [Faceplugin Face Recognition Server SDK](/products/face-recognition-sdk/recognition/server-sdk.md) · [Glossary](/help/resources/glossary.md)
* [Face Recognition Windows SDK](/products/face-recognition-sdk/recognition/server-sdk/face-recognition-windows-sdk.md) (HTTP API)
* [Request a License](/help/request-a-license-and-support.md) · [Status codes](/help/resources/status-codes.md)
* [Combining products (eKYC)](/getting-started/choose-a-product.md) · [SDK comparison](/help/comparisons.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.faceplugin.com/products/face-recognition-sdk/recognition-and-liveness/recognition-and-liveness-server/face-recognition-dot-net-sdk.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
