MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
C#
Latest commit 1a54b40 Jan 3, 2017 @yfakariya yfakariya Update change log.
Permalink
Failed to load latest commit information.
.nuget update nuget.exe May 22, 2016
assets Add small icon image. Sep 6, 2014
build Update version. Dec 5, 2016
samples Refine samples. Oct 25, 2016
src Fix a combination of deserialization constructor and collection typed… Jan 3, 2017
test Add test for #207 Jan 3, 2017
tools Update mpu.exe. Jul 23, 2016
.editorconfig Add contribution notes. Apr 26, 2015
.gitignore Exclude AppPackages/ subdirectory. Jun 4, 2016
AUTHORS.txt Restructure directories to bring up CLI tree as top. May 23, 2012
BuildNote.txt Update API documentation related notes. Oct 6, 2013
CHANGES.txt Update change log. Jan 3, 2017
CONTRIBUTIONS.md Fix contributions.md. Jul 15, 2016
LICENSE.txt Restructure directories to bring up CLI tree as top. May 23, 2012
MsgPack.Windows.sln Merge netstandard projects. Jun 26, 2016
MsgPack.Xamarin.sln Fix iOS build. Sep 24, 2016
MsgPack.compats.sln Fix code analysis settings. Jun 11, 2016
MsgPack.mono.sln Unify .NET build and Mono build. Nov 24, 2013
MsgPack.nuspec Set minClientVersion to nuspec. #177 Sep 24, 2016
MsgPack.shfbproj Update help file build configuration. Aug 15, 2015
MsgPack.sl5.shfbproj Add Sandcastle files. Aug 15, 2012
MsgPack.sln Reflect vs version. Dec 4, 2016
README.md Update versions, notes, and tools. Mar 9, 2016
SOURCES.txt Fix txt file encodings. May 4, 2013
Sync.Test.xml Change compile and assembly loading for .NET 4 to Roslyn based. Oct 24, 2016
Sync.xml Change compile and assembly loading for .NET 4 to Roslyn based. Oct 24, 2016
SyncProjects.bat Update project synchronization tool settings and synchronize projects. Sep 23, 2014
TODO.md Add documents. Jul 20, 2015
appveyor-debug.yml Restore Android SDK fetch with version up. Sep 24, 2016
appveyor-release.yml Restore Android SDK fetch with version up. Sep 24, 2016
global.json Add CoreCLR unit test project w/ NUnit. Jun 26, 2016
msgpack.ico Add icon. Jul 21, 2013

README.md

MessagePack for CLI

What is it?

This is MessagePack serialization/deserialization for CLI (Common Language Infrastructure) implementations such as .NET Framework, Silverlight, Mono (including Moonlight.) This library can be used from ALL CLS compliant languages such as C#, F#, Visual Basic, Iron Python, Iron Ruby, PowerShell, C++/CLI or so.

Usage

You can serialize/deserialize objects as following: 1. Create serializer via MessagePackSerializer.Create generic method. This method creates dependent types serializers as well. 1. Invoke serializer as following: ** Pack method with destination Stream and target object for serialization. ** Unpack method with source Stream.

// Creates serializer.
var serializer = SerializationContext.Default.GetSerializer<T>();
// Pack obj to stream.
serializer.Pack(stream, obj);
// Unpack from stream.
var unpackedObject = serializer.Unpack(stream);
' Creates serializer.
Dim serializer = SerializationContext.Default.GetSerializer(Of T)()
' Pack obj to stream.
serializer.Pack(stream, obj)
' Unpack from stream.
Dim unpackedObject = serializer.Unpack(stream)

Features

  • Fast and interoperable binary format serialization with simple API.
  • Generating pre-compiled assembly for rapid start up.
  • Flexible MessagePackObject which represents MessagePack type system naturally.

Documentation

See wiki

Installation

  • Binary files distributed via the NuGet package MsgPack.Cli.
  • You can extract binary (DLL) file as following:
    1. Download *.zip file from GitHub Release page.
    2. Extract it.
    3. Under the bin directory, binaries are there!
      • For mono, you can use net461 or net35 drops as you run with.
      • For Unity, unity3d drop is suitable.

How to build

For .NET Framework

  1. Install recent Windows SDK (at least, .NET Framework 4 Client Profile and MSBuild is needed.)
    Or install Visual Studio or Visual Studio Express.
    1. If you want to build unit test assemblies, install NuGet and then restore NUnit packages.
  2. Run:

    msbuild MsgPack.sln

    Or (for .NET 3.5 drops and Unity 3D drops):

    msbuild MsgPack.compats.sln

    Or (for Windows Runtime/Phone drops and Silverlight 5 drops):

    msbuild MsgPack.Windows.sln

    Or (for Xamarin drops, you must have Xamarin Business or upper license and Mac machine on the LAN to build on Windows):

    msbuild MsgPack.Xamarin.sln

Or open one of above solution files in your IDE and run build command in it.

For Mono

Open MsgPack.mono.sln with MonoDevelop and then click Build menu item. (Of cource, you can build via xbuild.)

Own Unity 3D Build

First of all, there are binary drops on github release page, you should use it to save your time. Because we will not guarantee source code organization compatibilities, we might add/remove non-public types or members, which should break source code build. If you want to import sources, you must include just only described on MsgPack.Unity3D.csproj. If you want to use ".NET 2.0 Subset" settings, you must use just only described on MsgPack.Unity3D.CorLibOnly.csproj file, and define CORLIB_ONLY compiler constants.

See also