Building Ice Applications for .NET
This page provides important information for .NET developers.
On this page:
Building Ice Applications for .NET with Visual Studio
Install the following software and then refer to the Ice Builder for Visual Studio instructions:
- The Ice Builder for Visual Studio extension
- The
zeroc.ice.netNuGet package described later on this page - With Visual Studio 2019, 2022, or 2026.
Building Ice Applications for .NET with the .NET 8.0 SDK or .NET 10.0 SDK
Install the following software and then refer to the Ice Builder for MSBuild instructions:
The .NET 8.0 SDK or the .NET 10.0 SDK for your operating system
- The
zeroc.ice.netNuGet package described later on this page
On Windows, you can use Ice Builder for Visual Studio to configure Ice Builder for MSBuild.
Programming Language
You can use any .NET programming language with Ice, however, the preferred programming language for Ice .NET applications is C# since:
- the only Slice language mapping for .NET is Slice to C#
- the only Slice compiler for .NET,
slice2cs, generates C# code - Ice for .NET is itself written in C#
zeroc.ice.net NuGet Package
The Ice for .NET (zeroc.ice.net) NuGet package is organized as follows:
Folder | Contents |
|---|---|
lib\netstandard2.0 | Assemblies for .NET Standard 2.0 |
tools\windows-x64 | slice2cs compiler |
| |
| |
| |
tools\net472 |
|
tools\net8.0 | iceboxnet.dll app for .NET 8.0 |
build | MSBuild support files |
slice | Slice files |
Adding zeroc.ice.net to a Visual Studio or MSBuild project imports props files from the build folder into that project.
The props file defines the following properties:
Name | Value | Description |
|---|---|---|
IceVersion | 3.7 | Ice string version |
IceIntVersion | 30711 | Ice version as a numeric value |
IceVersionMM | 3.7 | Major Minor version |
IceSoVersion | 37 | Version used in dynamic libraries |
IceNugetPackageVersion | 3.7.11 | NuGet package numeric version |
IceHome | $(MSBuildThisFileDirectory)..\.. | Full path to the package root folder |
IceToolsPath | $(IceHome)\tools | Full path to the tools folder |
These properties are used by Ice Builder, and you can also use them in custom build steps.
Compression with bzip2
Ice for .NET supports the optional compression of Ice requests and responses using the bzip2 native library. You can use the bzip2 system library on Linux and macOS. On Windows, use the bzip2.dll included in the C++ NuGet package.
Using the Sample Programs
Sample programs are available at the ice-demos GitHub repository. You can browse this repository to see build and usage instructions for all supported programming languages. You can clone this repository with:
git clone -b 3.7 https://github.com/zeroc-ice/ice-demos.git cd ice-demos