summaryrefslogtreecommitdiff
path: root/csharp/BuildInstructions.md
blob: b32f975927711b3fd3970808473395cc746ed40c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Building Ice for .NET

This page describes how to build and install Ice for .NET from source code using
Visual Studio. If you prefer, you can also download [binary distributions][1]
for the supported platforms.

## Build Requirements

### Operating Systems and Compilers

Ice for .NET was extensively tested using the operating systems and compiler
versions listed for our [supported platforms][2].

The build requires the [Ice Builder for Visual Studio][3]. You must install
version 4.3.6 or greater to build Ice.

## Compiling Ice for .NET with Visual Studio

### Preparing to Build

The build system requires the `slice2cs` compiler from Ice for C++. If you have
not built Ice for C++ in this source distribution, refer to the
[C++ build instructions](../cpp/BuildInstructionsWindows.md).

### Building Ice for .NET

Open a Visual Studio command prompt and change to the `csharp` subdirectory:

    cd csharp

To build the Ice assemblies, services and tests, run

    msbuild msbuild\ice.proj

Upon completion, the Ice assemblies are placed in the `Assemblies` subdirectory.

You can add Strong Naming signatures to Ice assemblies by setting the following
environment variables:

 - PUBLIC_KEYFILE Identity public key used to delay sign the assembly
 - KEYFILE Identity full key pair used to sign the assembly

If only PUBLIC_KEYFILE is set, the assemblies are delay signed during the build
and you must re-sign the assemblies with the full identity key pair.

If only KEYFILE is set, the assemblies are fully signed during the build using
KEYFILE.

If both PUBLIC_KEYFILE and KEYFILE are set, assemblies are delay signed during
the build using PUBLIC_KEYFILE and re-signed after the build using KEYFILE.
This can be used for generating [Enhanced Strong Naming](3) signatures.

You can also sign the Ice binaries with Authenticode by setting the following
environment variables:

 - SIGN_CERTIFICATE to your Authenticode certificate
 - SIGN_PASSWORD to the certificate password

If you want to build the test suite without building the entire source base, use
this command:

    msbuild msbuild\ice.proj /p:ICE_BIN_DIST=all

The build will automatically install ZeroC's official Ice binary NuGet packages
if necessary.

## Running the .NET Tests

Python is required to run the test suite. Additionally, the Glacier2 tests
require the Python module `passlib`, which you can install with the command:

    > pip install passlib

To run the tests, open a command window and change to the top-level directory.
At the command prompt, execute:

    > python allTests.py

If everything worked out, you should see lots of `ok` messages. In case of a
failure, the tests abort with `failed`.

## Targeting Managed Code

Ice invokes unmanaged code to implement the following features:

- Protocol compression
- Signal processing in the Ice.Application class

if you do not require these features and prefer that the Ice run time use only
managed code, you can build using the `Debug-Managed` or `Release-Managed`
configurations:

    msbuild msbuild\ice.proj /p:Configuration=Release-Managed

## NuGet packages

To create a NuGet package for the distribution, use the following command:

    msbuild msbuild\ice.proj /t:NuGetPack

This will create `zeroc.ice.net\zeroc.ice.net.nupkg`.

[1]: https://zeroc.com/distributions/ice
[2]: https://doc.zeroc.com/display/Rel/Supported+Platforms+for+Ice+3.7.0
[3]: https://github.com/zeroc-ice/ice-builder-visualstudio
[4]: https://docs.microsoft.com/en-us/dotnet/framework/app-domains/enhanced-strong-naming