An open API service indexing awesome lists of open source software.

https://github.com/hanabi1224/protobuf.codegen.buildtask

MSBuild task to automatically generate c# files from .proto files
https://github.com/hanabi1224/protobuf.codegen.buildtask

protobuf protobuf-net protobuf3 protobuffer

Last synced: about 1 month ago
JSON representation

MSBuild task to automatically generate c# files from .proto files

Awesome Lists containing this project

README

        

# Protobuf.CodeGen.BuildTask

[![Build status](https://img.shields.io/appveyor/ci/hanabi1224/protobuf-codegen-buildtask/master.svg)](https://ci.appveyor.com/project/hanabi1224/protobuf-codegen-buildtask)
[![Build Status](https://img.shields.io/travis/hanabi1224/Protobuf.CodeGen.BuildTask/master.svg)](https://travis-ci.org/hanabi1224/Protobuf.CodeGen.BuildTask)
[![MIT License](https://img.shields.io/github/license/hanabi1224/Protobuf.CodeGen.BuildTask.svg)](https://github.com/hanabi1224/Protobuf.CodeGen.BuildTask/blob/master/LICENSE)
[![NuGet version](https://buildstats.info/nuget/Protobuf.CodeGen.BuildTask)](https://www.nuget.org/packages/Protobuf.CodeGen.BuildTask)
====

MSBuild task that automatically uses official protoc binary in [Google.Protobuf.Tools](https://www.nuget.org/packages/Google.Protobuf.Tools/) to generate c# files from .proto files. In order to build the generated c# files, it adds official [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) as indirect reference to your project as well

Install via [nuget](https://www.nuget.org/packages/Protobuf.CodeGen.BuildTask)

or add below code snippet to your .csproj file

Windows, Linux, OSX are all supported and tested

```


All

```

The generated files will be under obj/_ProtobufCodeGen folder, which will be gitignored by default.

The unit test project [here](https://github.com/hanabi1224/Protobuf.CodeGen.BuildTask/tree/master/test/Protobuf.CodeGen.BuildTask.Tests) is a good example to demonstrate the usage of this package.

As a side note, all the .proto files are also distributed together with the output dll as embedded resources, which can be inspected by tools like [ILSpy](https://github.com/icsharpcode/ILSpy).