GridGain for .NET/C#
This chapter explains how to use .NET Core to build and run a simple Hello World example in .NET that starts a node, puts a value into the node and then gets the value.
Prerequisites
GridGain.NET was officially tested on:
JDK |
Oracle JDK 8 and later, Open JDK 8 and later, IBM JDK 8 and later |
.NET Framework |
.NET 4.0+, .NET Core 2.0+ |
Running a Simple .NET Example
-
Install .NET Core SDK (version 2+): https://dotnet.microsoft.com/download
-
Use the CLI (unix shell, Windows CMD or PowerShell, etc.) to run the following two commands:
> dotnet new console
This creates an empty project, which includes a project file with metadata and a .cs file with code.
And:
> dotnet add package GridGain.Ignite
This modifies the project file -
.csproj
- to add dependencies. -
Open
Program.cs
in any text editor and replace the contents with the following:using System; using Apache.Ignite.Core; namespace ggqsg { class Program { static void Main(string[] args) { var ignite = Ignition.Start(); var cache = ignite.GetOrCreateCache<int, string>("my-cache"); cache.Put(1, "Hello, World"); Console.WriteLine(cache.Get(1)); } } }
-
Save and then run the program:
> dotnet run
And that’s it! You should see a node launch and then display "Hello, World".
Next Steps
From here, you may want to:
-
Read more about using GridGain: Developers Guide, Administrators Guide
-
Use GridGain Control Center to monitor your cluster
-
Explore the additional examples included with GridGain
© 2021 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.