protobuf/csharp
Jon Skeet c1c6b2d0d5 Implemented Jan's suggestion of FieldCollection, replacing FieldAccessorCollection.
I think Jan was actually suggesting keeping both, but that feels redundant to me. The test diff is misleading here IMO, because I wouldn't expect real code using reflection to use several accessors one after another like this, unless it was within a loop. Evidence to the contrary would be welcome :)

This change also incidentally goes part way to fixing the issue of the JSON formatter not writing out the fields in field number order - with this change, it does except for oneofs, which we can fix in a follow-up change.

I haven't actually added a test with a message with fields deliberately out of order - I'm happy to do so though. It feels like it would make sense to be in google/src/protobuf, but it's not entirely clear what the rules of engagement are for adding new messages there. (unittest_proto3.proto?)
2015-07-22 20:13:38 +01:00
..
keys First pass at the big rename from ProtocolBuffers to Google.Protobuf. 2015-07-17 08:26:04 +01:00
protos/extest Fix for doubly-nested types - issue #307. 2015-06-29 09:27:54 +01:00
src Implemented Jan's suggestion of FieldCollection, replacing FieldAccessorCollection. 2015-07-22 20:13:38 +01:00
.gitignore First pass at the big rename from ProtocolBuffers to Google.Protobuf. 2015-07-17 08:26:04 +01:00
build_packages.bat First pass at the big rename from ProtocolBuffers to Google.Protobuf. 2015-07-17 08:26:04 +01:00
buildall.sh Fix typo in buildall.sh 2015-07-17 12:19:20 -07:00
CHANGES.txt Updated readme.md and changes.txt, removed old license.txt 2015-04-16 10:23:54 -07:00
generate_protos.sh First pass at the big rename from ProtocolBuffers to Google.Protobuf. 2015-07-17 08:26:04 +01:00
README.md First pass at the big rename from ProtocolBuffers to Google.Protobuf. 2015-07-17 08:26:04 +01:00

This directory contains the C# Protocol Buffers runtime library.

Warning: experimental!

This code is still under significant churn. Unlike the original port, it only supports proto3 (but not all of proto3 yet) - there are no unknown fields or extensions, for example. protoc will (eventually) deliberately fail if it is asked to generate C# code for proto2 messages other than descriptor.proto, which is still required for reflection. (It's currently exposed publicly, but won't be eventually.)

Also unlike the original port, the new version embraces mutability - there are no builder types. We plan to add "freezing" operations as well as cloning, however.

Usage

Use protoc with the --csharp_out option to generate C# files in the specified directory. Include these in your C# project, and add a reference to the Google.Protobuf project. Currently there is no NuGet package for this, but we will be building one as soon as the API is stable.

Building

Open the src/Google.Protobuf.sln solution in Visual Studio. Click "Build solution" to build the solution. You should be able to run the NUnit test from Test Explorer (you might need to install NUnit Visual Studio add-in).

Supported Visual Studio versions are VS2013 (update 4) and VS2015. On Linux, you can also use Monodevelop 5.9 (older versions might work fine).

History of C# protobufs

This subtree was originally imported from https://github.com/jskeet/protobuf-csharp-port and represents the latest development version of C# protobufs, that will now be developed and maintained by Google. All the development will be done in open, under this repository (https://github.com/google/protobuf).