Skip to content

Generate .proto files during build time from a .NET contract assembly #317

Open
@rodrigovaras

Description

@rodrigovaras

Hello,
I have a rather complex SDK framework where all of the RPC contracts were defined in C# and marked with DataContract & DataMember attributes. I have recently allowed our RPC services to allow serialize using protobuf protocol with good success.

I'm looking now for a way to produce valid and compatible proto files so we can have regular gRPC clients in other languages to interact with our services.

I understand some there is an API to allow the generation but i would prefer an msbuild task to do this job during build time like the opposite happen from .proto files to C#.
I'm missing a project that show this? Most of the discussion are related to the SchemaGenerator but mostly showing the way to write a tool or doing this on runtime.

Also i notice that most of the .NET API to generate proto is based on a [ServiceContract] attribute. Would like to know if there are other ways to trigger .proto generation for example a set of classes from a namespace regardless they participate on a service contract.
Thanks in advance,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions