Building Ice Applications for .NET for Ice 3.7.6
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.net
NuGet package described later on this page - With Visual Studio 2017 and 2019, you can optionally install the .NET Core cross-platform development workload to create applications for .NET Core.
Building Ice Applications for .NET with the .NET Core SDK
Install the following software and then refer to the Ice Builder for MSBuild instructions:
The .NET Core 3.1 SDK for your operating system
- The
zeroc.ice.net
NuGet package described later on this page - The
slice2cs
compiler
slice2cs
is a command-line tool written in C++ and available on most platforms
Platform | Distribution | Package with slice2cs |
---|---|---|
Debian, Ubuntu | apt packages |
|
Amazon Linux, RedHat Enterprise Linux, SUSE Linux | RPMs |
|
Windows | NuGet | zeroc.ice.net |
macOS | Homebrew | ice |
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\net45 | Assemblies for .NET Framework 4.5.1 |
lib\net5.0 | Assemblies for .NET 5.0 |
lib\netstandard2.0 | Assemblies for .NET Standard 2.0 |
tools | slice2cs.exe (Windows-only native tools) |
tools\net45 |
|
tools\net5.0 | iceboxnet.dll app for .NET 5.0, bzip2.dll Windows x64 native library |
tools\netcoreapp2.1 |
|
tools\netcoreapp3.1 | iceboxnet.dll app for .NET Core 3.1, bzip2.dll Windows x64 native library |
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 | 30705 | Ice version as a numeric value |
IceVersionMM | 3.7 | Major Minor version |
IceSoVersion | 37 | Version used in dynamic libraries |
IceNugetPackageVersion | 3.7.5 | 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.
.NET Framework and .NET Standard Assemblies
zeroc.ice.net
includes two sets of Ice assemblies: one set of assemblies for the .NET Framework 4.5 and another set for .NET Standard 2.0.
These assemblies are the same except for the differences described below:
.NET Framework 4.5 Assemblies | .NET 5.0 | .NET Standard 2.0 Assemblies | |
---|---|---|---|
Run-time platform | Windows | Linux, macOS, Windows | Android, iOS, Linux, macOS, UWP, Windows |
Target Framework | .NET Framework 4.5.1 or greater on Windows | .NET 5.0 | Any implementation of .NET Standard 2.0, including .NET Core 3.1, .NET Core 2.2 , .NET Core 2.1 and .NET Framework 4.6.1. |
Ice properties can be read from the Windows Registry | |||
Signals caught by Ice.Application | Signal catching implemented using the Windows native function SetConsoleCtrlHandler. | Signal catching implemented using the portable .NET event Console.KeyPress. | Signal catching implemented using the portable .NET event Console.KeyPress. |
The .NET Standard 2.0 assemblies are expected to work with any .NET implementation of .NET Standard 2.0, however they are tested primarily with .NET Core 3.1, .NET Core 2.2 and 2.1 on Android, iOS, Linux, macOS and Windows.
Compression with bzip2
Ice for .NET supports the optional compression of Ice requests and responses using the bzip2 native library. The bzip2 native DLL for Windows x64 is included in the zeroc.ice.net
package. You can use the bzip2 system library on Linux and macOS.
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