This repository contains sample projects using the Security Center SDK. The samples demonstrate various features and capabilities of the Security Center SDK.
Security Center is Genetec's unified security platform that blends IP security systems within a single intuitive interface to simplify operations. It combines access control, video surveillance, automatic license plate recognition, communications, and analytics into one solution, enabling organizations to enhance their security operations and gain valuable insights.
Visit Genetec's DAP and join the program. This will provide you with access to the SDK documentation, installer, and a development license for Security Center.
-
Install Security Center: Ensure you have Security Center installed. You can download the installer from the Genetec Portal.
-
Activate Development License: Activate the Security Center license provided by the DAP. This license allows your integration to connect to Security Center.
-
Install Security Center SDK: The SDK contains the necessary libraries to build and run custom integrations. Download and install the Security Center SDK from the Genetec Portal. This will create the necessary environment variables automatically:
GSC_SDK
: Points to the location of the Genetec SDK for .NET Framework 4.8.1GSC_SDK_CORE
: Points to the location of the Genetec SDK for .NET 8
-
Development Tools:
- Visual Studio: Ensure you have Visual Studio 2022 (or later) installed.
- .NET Framework 4.8.1: The sample projects can be built using .NET Framework 4.8.1, which is supported by all versions of Security Center.
- .NET 8: The sample projects can be built using .NET 8, but only with Security Center SDK 5.12.2 or later.
-
Build and Run the Samples: Once your environment is ready, you can open the sample projects in Visual Studio, build them and run them.
After setting up your environment, you can explore the sample projects in this repository. Each sample demonstrates a different feature or capability of the SDK, such as video management, access control, and system events.
The sample projects in this repository are structured as follows:
-
Target Frameworks: The samples support .NET Framework 4.8.1. Some samples may also support .NET 8 for use with Security Center SDK 5.12.2 or later.
-
Project Output: The sample projects typically compile to one of the following:
- Executable files (.exe) for standalone applications
- Class libraries (.dll) for Workspace modules and Plugins
-
SDK References:
- For .NET Framework 4.8.1: The projects reference Security Center assemblies from the
$(GSC_SDK)
directory. - For .NET 8: The projects reference Security Center assemblies from the
$(GSC_SDK_CORE)
directory.
- For .NET Framework 4.8.1: The projects reference Security Center assemblies from the
-
Additional Features:
- Some projects include a post-build step to copy certificate files to the output directory.
- Projects may share common code through the use of shared project items.
The sample projects support both .NET Framework 4.8.1 and .NET 8, depending on the Security Center SDK version. Here's how to work with different target frameworks:
-
Check the current target frameworks:
- Edit the project file (.csproj) or view its properties in Visual Studio.
- Look for the
<TargetFrameworks>
element.
-
Target .NET Framework 4.8.1:
- Ensure your project file includes:
<TargetFrameworks>net481</TargetFrameworks>
- Ensure your project file includes:
-
Target .NET 8:
- Ensure your project file includes:
<TargetFrameworks>net8.0-windows</TargetFrameworks>
- Ensure your project file includes:
-
Target both .NET Framework 4.8.1 and .NET 8:
- Modify your project file to include:
<TargetFrameworks>net481;net8.0-windows</TargetFrameworks>
- Modify your project file to include:
-
Build for a specific framework:
- In Visual Studio: Use the Configuration Manager to set up different build configurations for each framework (see detailed guide below).
- Command line: Specify the target framework when building:
or
dotnet build -f net481
dotnet build -f net8.0-windows
Remember to use the appropriate version of the Security Center SDK that matches your target framework. The .NET 8 target requires Security Center SDK 5.12.2 or later.
-
Open Configuration Manager:
- In Visual Studio, go to the "Build" menu.
- Select "Configuration Manager" near the bottom of the dropdown.
-
Create New Configuration:
- In the Configuration Manager dialog, click on the "Active solution configuration" dropdown.
- Select "New" at the bottom of the list.
- Name your new configuration (e.g., "Debug-net481" for .NET Framework 4.8.1 debug build).
- Choose which existing configuration to copy settings from (usually "Debug").
- Click "OK" to create the new configuration.
-
Set Project Properties for the New Configuration:
- Right-click on your project in the Solution Explorer.
- Select "Properties" at the bottom of the context menu.
- In the project properties, ensure the new configuration is selected in the "Configuration" dropdown at the top.
- Go to the "Build" tab.
- In the "Conditional compilation symbols" field, add "NETFRAMEWORK" (without quotes) for .NET Framework builds.
- In the "Target framework" dropdown, select ".NET Framework 4.8.1".
- Save the changes.
-
Repeat for .NET 8:
- Follow steps 2 and 3 to create a new configuration for .NET 8 (e.g., "Debug-net8").
- In the project properties for this configuration, set the target framework to ".NET 8.0".
- Instead of "NETFRAMEWORK", use "NET8_0" in the conditional compilation symbols.
-
Set Up Release Configurations:
- Repeat steps 2-4 to create Release configurations for both frameworks.
-
Use the Configurations:
- In Visual Studio's main toolbar, use the "Solution Configurations" dropdown to switch between your new configurations.
- When you build the project, it will use the settings for the selected configuration.
-
Conditional Code:
- You can now use conditional compilation in your code:
#if NETFRAMEWORK // .NET Framework specific code #elif NET8_0 // .NET 8 specific code #endif
- You can now use conditional compilation in your code:
Complete documentation for the Security Center SDK can be found on the Genetec Developer Portal. You will need to create an account to access the documentation.
Please refer to the LICENSE file for information about permissions and limitations for using these SDK samples.
While this repository is primarily for reference purposes, contributions such as bug reports, feature requests, and code improvements are welcome. Please follow the guidelines outlined in the CONTRIBUTING file.
If you encounter any issues or have questions regarding the Security Center SDK or the provided samples, please reach out to the Genetec support team through the Genetec Technical Assistance Portal.