grpc / grpc/grpc-dotnet

`google/protobuf/go_features.proto : error : File not found` when generating C# code

Open
#2,674 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

I have a .proto file starting with:

```proto
edition = "2023";

import "google/protobuf/go_features.proto";
option features.(pb.go).api_level = API_OPAQUE;

option go_package = "...";
option csharp_namespace = "...";

import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

message Message {
...
}
```

When trying to generate C# gRPC code for this proto file I get an error message:

```
google/protobuf/go_features.proto : error : File not found. [/.../....csproj]
proto/proto.proto(3,1): error : Import "google/protobuf/go_features.proto" was not found or had errors. [/.../....csproj]
```

Compiling protobuf files that don't import go_features.proto seems to work fine.

Contributor guide

Open the contributing guide

Research direction

Start with proto/proto.proto and the .csproj configuration, then inspect how the C# gRPC generator resolves imported Google protobuf files. Compare the failing google/protobuf/go_features.proto import with the working struct.proto and timestamp.proto imports; done means C# generation succeeds for the shown proto without the file-not-found errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.