Protocol buffers in C# projects using protobuf-net - best practices for code generation

前端 未结 6 1527
盖世英雄少女心
盖世英雄少女心 2021-01-31 05:35

I\'m trying to use protobuf in a C# project, using protobuf-net, and am wondering what is the best way to organise this into a Visual Studio project structure.

When manu

6条回答
  •  时光取名叫无心
    2021-01-31 06:21

    Add this to the relevant project file.

    Advantage, incremental build.

    Disadvantage, you need to edit manually when adding files.

    
        
        
            Person.proto
        
    
    
        ProtobufGenerate;$(CompileDependsOn)
    
    
        
            <_protoc Include="..\packages\Google.Protobuf.*\tools\protoc.exe" />
        
        
        
    
    

提交回复
热议问题