Skip to content

Google.Protobuf.Tools and Grpc.Tools proto compilation is only supported by default in a C# project (extension .csproj) #20515

@jozefizso

Description

@jozefizso

What version of gRPC and what language are you using?

grpc 1.18.0

What operating system (Linux, Windows,...) and version?

Windows

What runtime / compiler are you using (e.g. python version or version of gcc)

.NET Framework 4.7.2
Grpc.Tools 1.18.0

What did you do?

When I open .NET project in VS 2017 and/or 2019 and I run build, Grpc.Tools often reports this error: Google.Protobuf.Tools proto compilation is only supported by default in a C# project (extension .csproj)

This error is mostly reported on a project which was recently checked out and it's nuget packages are missing. After restoring packages and running build, msbuild will likely report this error.

When I run Build > Build Solution several times in a row, the project finally build correctly. As I change the .proto file in the project and run Build again, I got the error message again.

This causes issues with build machines which do clean builds and are thus failing the build. And it causes to developers as they local builds are often reported as failed.

What did you expect to see?

Project should build correctly.

What did you see instead?

msbuild error: Google.Protobuf.Tools proto compilation is only supported by default in a C# project (extension .csproj)

Full build log: https://gist.github.com/jozefizso/383d6d1346a0ffcd8dde5e5955384070

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions