README.md
1This directory contains the C# Protocol Buffers runtime library.
2
3Status: Beta - ready for external testing
4=========================================
5
6Usage
7=====
8
9The easiest way how to use C# protobufs is via the `Google.Protobuf`
10NuGet package. Just add the NuGet package to your VS project.
11
12Besides C# runtime library, the NuGet package also contains
13precompiled version of `protoc.exe` and a copy of well known `.proto`
14files under the package's `tools` directory.
15
16To generate C# files from your `.proto` files, invoke `protoc` with the
17`--csharp_out` option.
18
19Supported platforms
20===================
21
22The runtime library is built as a portable class library, supporting:
23
24- .NET 4.5
25- Windows 8
26- Windows Phone Silverlight 8
27- Windows Phone 8.1
28- .NET Core
29
30You should be able to use Protocol Buffers in Visual Studio 2012 and
31all later versions. This includes all code generated by `protoc`,
32which only uses features from C# 3 and earlier.
33
34Building
35========
36
37Open the `src/Google.Protobuf.sln` solution in Visual Studio 2015 or
38later. You should be able to run the NUnit test from Test Explorer
39(you might need to install NUnit Visual Studio add-in).
40
41Although *users* of this project are only expected to have Visual
42Studio 2012 or later, *developers* of the library are required to
43have Visual Studio 2015 or later, as the library uses C# 6 features
44in its implementation. These features have no impact when using the
45compiled code - they're only relevant when building the
46`Google.Protobuf` assembly.
47
48History of C# protobufs
49=======================
50
51This subtree was originally imported from https://github.com/jskeet/protobuf-csharp-port
52and represents the latest development version of C# protobufs, that will now be developed
53and maintained by Google. All the development will be done in open, under this repository
54(https://github.com/google/protobuf).
55
56The previous project differs from this project in a number of ways:
57
58- The old code only supported proto2; the new code only supports
59proto3 (so no unknown fields, no required/optional distinction, no
60extensions)
61- The old code was based on immutable message types and builders for
62them
63- The old code did not support maps or `oneof`
64- The old code had its own JSON representation, whereas the new code
65uses the standard protobuf JSON representation
66- The old code had no notion of the "well-known types" which have
67special support in the new code
68- The old project supported some older platforms (such as older
69versions of Silverlight) which are not currently supported in the
70new project
71