If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.
The Senzing C# SDK provides the C# interface to the native Senzing SDK's.
This repository is dependent on the Senzing native shared library (.so,
.dylib or .dll) that is part of the Senzing product and function without it.
While this SDK is being made available as open source, the actual Senzing.Sdk
NuGet package file (Senzing.Sdk.4.0.0.nupkg) that you use should be
obtained from Senzing product installation to ensure that the C# code version
matches the native library version.
-
Microsoft .NET for your platform: https://dotnet.microsoft.com/en-us/download
-
Senzing v4.0 or later (for running unit tests)
-
Set the
SENZING_PATHenvironment variable:- Linux:
export SENZING_PATH=/opt/senzing - macOS:
export SENZING_PATH=$HOME/senzing - Windows:
set SENZING_PATH=%USERPROFILE%\senzing
- Linux:
-
Set your library path appropriately for Senzing libraries:
-
Linux: Set the
LD_LIBRARY_PATH:export LD_LIBRARY_PATH=/opt/senzing/er/lib:$LD_LIBRARY_PATH -
macOS: Set
DYLD_LIBRARY_PATH:export DYLD_LIBRARY_PATH=/Library/Senzing/er/lib:/Library/Senzing/er/lib/macos:$DYLD_LIBRARY_PATH -
Windows: Set
Path:set Path=C:\Senzing\er\lib;%Path%
-
-
Generating the Example Documentation Snippets
dotnet test Senzing.Sdk.Demo -p:GeneratePackageOnBuild=falseAlternatively, via
Makefile:gmake demo -
Building with Debug:
dotnet build Senzing.Sdk -p:GenerateDocumentationFile=trueNOTE: This will produce warnings if you have NOT generated the example documentation snippets.
Alternatively, via
Makefileit will always generate the documentation example snippets first:gmake debugThe DLL will be found in
Senzing.Sdk/bin/Debug/netstandard2.0/Senzing.Sdk.dllThe NuGet package will be found inSenzing.Sdk/bin/Debug/Senzing.Sdk.4.0.0.nupkg -
Building with Release:
dotnet build -c Release Senzing.Sdk -p:GenerateDocumentationFile=trueAlternatively, via
Makefileit will always generate the documentation example snippets first:gmake releaseNOTE: This will produce warnings if you have NOT generated the example documentation snippets.
The DLL will be found in
Senzing.Sdk/bin/Release/netstandard2.0/Senzing.Sdk.dllThe NuGet package will be found inSenzing.Sdk/bin/Release/Senzing.Sdk.4.0.0.nupkg -
Running unit tests:
dotnet test Senzing.Sdk.TestsAlternatively, via
Makefile:gmake release -
Verifying the code formatting:
dotnet format --verify-no-changes --verbosity diagnostic Senzing.Sdk dotnet format --verify-no-changes --verbosity diagnostic Senzing.Sdk.Tests dotnet format --verify-no-changes --verbosity diagnostic Senzing.Sdk.Demo
Alternative, via
Makefile:gmake formatOr for each module individually:
gmake format-sdk gmake format-test gmake format-demo
-
Generate documentation:
dotnet docfx docfx.jsonAlternatively, via
Makefile:gmake docsThe generated documentation will reside in
target/apidocs/_site/ -
Clean up build artifacts:
dotnet clean Senzing.Sdk dotnet clean -c Release Senzing.Sdk dotnet clean Senzing.Sdk.Tests dotnet clean Senzing.Sdk.Demo rm -rf Senzing.Sdk/bin rm -rf Senzing.Sdk/obj rm -rf Senzing.Sdk.Tests/bin rm -rf Senzing.Sdk.Tests/obj rm -rf Senzing.Sdk.Demo/bin rm -rf Senzing.Sdk.Demo/obj rm -rf target
Alternative, via
Makefile:gmake clean
-
Create and configure a local NuGet repository:
mkdir [path] dotnet nuget add source [path] -n [local-source-name]
-
Example (macOS / Linux):
mkdir -p ~/dev/nuget/packages dotnet nuget add source ~/dev/nuget/packages -n dev
-
Example (Windows):
mkdir %USERPROFILE%\dev\nuget\packages dotnet nuget add source %USERPROFILE%\dev\nuget\packages -n dev
-
-
Push the
Senzing.SdkNuGet package from your Senzing distribution to your local repository:dotnet nuget push [path-to-Senzing.Sdk.4.0.0.nupkg] --source [local-source-name]-
Example (macOS / Linux):
dotnet nuget push /opt/senzing/er/sdk/dotnet/Senzing.Sdk.4.0.0.nupkg --source dev -
Example (Windows):
dotnet nuget push %USERPROFILE%\Senzing\er\sdk\dotnet\Senzing.Sdk.4.0.0.nupkg --source dev
-
-
Add the
Senzing.SdkNuGet package as a dependency to your project:-
OPTION 1: Add the latest pre-release version of Senzing.Sdk as your dependency:
dotnet add [your-project-name] package Senzing.Sdk --prerelease -
OPTION 2: Add a specific version of Senzing.Sdk as your dependency:
dotnet add [your-project-name] package Senzing.Sdk --version 4.0.0 -
OPTION 3: Add the latest production version of Senzing.Sdk as your dependency (note: this will only function once Senzing.Sdk v4.0.0 is released):
dotnet add [your-project-name] package Senzing.Sdk
-
Senzing encourages and allows you to freely copy the provided example code and modify it to your own needs as you see fit. However, please refer to the Global Suppression Notes to understand how to best adapt the example code to your own coding project.