1# Grpc.Tools - Protocol Buffers/gRPC C# Code Generation Build Integration 2 3This package provides C# tooling support for generating C# code from `.proto` files in `.csproj` projects: 4* It contains protocol buffers compiler and gRPC plugin to generate C# code. 5* It can be used in building both grpc-dotnet projects and legacy c-core C# projects. 6 7The package is used to automatically generate the C# code for protocol buffer messages 8and gRPC service stubs from `.proto` files. These files: 9* are generated on an as-needed basis each time the project is built. 10* aren't added to the project or checked into source control. 11* are a build artifact usually contained in the `obj` directory. 12 13This package is optional. You may instead choose to generate the C# source files from 14`.proto` files by running the `protoc` compiler manually or from a script. 15 16## Simple example 17 18To add a `.proto` file to a project edit the project’s `.csproj` file and add an item group with a `<Protobuf>` element that refers to the `.proto` file, e.g. 19 20```xml 21<ItemGroup> 22 <Protobuf Include="Protos\greet.proto" /> 23</ItemGroup> 24``` 25 26For more complex examples and detailed information on how to use this package see: [BUILD-INTEGRATION.md](https://github.com/grpc/grpc/blob/master/src/csharp/BUILD-INTEGRATION.md) 27