dotnet / dotnet/wpf

Issue: protobuf-net.BuildTools Not Generating C# from .proto in WPF .NET 8.0 Project

Open
#11,060 1 comment 1 reaction 0 assignees View on GitHub
:mailbox_with_no_mail: waiting-author-feedback
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Issue:-protobuf-netBuildTools-Not-Gener/10945475)._

---
Environment:

Project type: WPF (.NET 8.0)
Using protobuf-net v3.2.56 and protobuf-net. BuildTools v3.2.52 via NuGet
proto file placed under Protos\messages.proto
Visual Studio 2022 (latest version)

I dunno whats wrong, my .csproj includes:
```
<ItemGroup>
<Protobuf Include="Protos\messages.proto" ProtoRoot="Protos" />
<AdditionalFiles Include="Protos\messages.proto" />
</ItemGroup>
```

I also set Build Action = C# analyzer additional file in the properties for messages.proto, no build errors from the generator, but no generated .cs appears under obj/Debug/net8.0-windows/protobuf-net/; I confirmed that protobuf-net. BuildTools is installed and referenced properly.

Any idea why source generator isn't running?
are there specific limitations for WPF or .NET 8 SDK-style projects? is there a known workaround for forcing code generation in such cases?

Thanks!

---
### Original Comments

#### Ankit Virdi on 7/31/2025, 04:44 PM:

I checked the documentation for Protobuf, it doesnt mention .NET 8.00 so I tried it with 6.0 Framework, didn’t work? I should probably redo the whole project from scratch in a .NET 6.0 template?

#### Feedback Bot on 8/1/2025, 05:22 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.