From the course: Learning ASP.NET Core: MVC, Razor Pages, Web APIs & Other Foundations

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Generating C# assets

Generating C# assets

- [Isn't] I now have the proto files for my GRPC services in place. The next step is to use those proto files to generate C# server code that implements the services. We do that in ASP.NET Core using tooling available in a NuGet package. I've still got my main C# project file open here in my editor. The GRPC project template included a reference to the Grpc.AspNetCore package on line 15. That's a meta package that includes references to three other packages that assist with GRPC development. One of them is Grpc.Tools. That package includes tooling that will automatically read your proto files and generate C# code to implement them each time you build your project. The generated code files are added to the obj folder in your project. Therefore, they aren't referenced in your project and aren't added to your source control system. I'll open the VS Code terminal and try it out. I'll build the project with the command dotnet build followed by the name of the C# project file. After a few…

Contents