Develop for XenServer

Getting Started with C #

The XenServer-SDK directory contains the following folders that are relevant to C# programmers:

  • XenServer.NET: The XenServer SDK for C#.NET.

    • XenServer.NET.x.y.z.nupkg: The compiled library shipped as a NuGet package.

    • src: XenServer.NET source code shipped as a Microsoft Visual Studio project. Every API object is associated with one C# file. For example, the functions implementing the VM operations are contained within the file VM.cs.

RPC protocol:

The C# SDK supports the JSON-RPC v2.0 protocol.

Platform supported:

  • Windows
  • Linux

The compiled library targets .NET Framework version 4.5 and .NET Standard 2.0.


The library is generated as a Dynamic Link Library XenServer.dll that C# programs can reference.

The C# SDK is backwards compatible and can be used to interact with hosts running all versions of XenServer or Citrix Hypervisor (from XenServer 7.3 and Citrix Hypervisor 8.0 onwards).


Newtonsoft JSON.NET by James Newton-King.


To use the NuGet package in your code, add its location as a NuGet source:

nuget sources Add -Name "Offline Package" -Source "/full/path/to/package/directory"

Then install the package:

nuget install XenServer.NET

Building the source code:

Open the project XenServer.csproj in Visual Studio 2022. You should now be ready to build the source code.


Examples on the usage of the C# SDK can be found at XenServer.NET usage examples on GitHub.

Getting Started with C #

In this article