Grpc.Tools C# ProtoCompile classes generation : No such file or directory

I’m running into a really weird error. My C# classes protoc generation process isn’t working anymore. But it used to works properly, and I’m not sure that I changed anything (I’m fairly certain that it worked great on a build, then the following one crashed)

I’m packaging a simple Nuget Package containing a Protos/ directory with 2 protofiles.

Using the Nuget Package Explorer, here is the Package contents:

Now I import the package in a new project, I also import the Grpc tools and I include the 2 Protofiles:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Tests.Tests.TestCodeFirstGrpc" Version="1.0.262" GeneratePathProperty="true" />
        <PackageReference Include="Google.Protobuf" Version="3.27.2" />
        <PackageReference Include="Grpc.Net.Client" Version="2.64.0" />
        <PackageReference Include="Grpc.Tools" Version="2.65.0">
            <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
    </ItemGroup>
    <ItemGroup>
        <Protobuf Include="$(PkgTests_Tests_TestCodeFirstGrpc)contentProtos***.proto" GrpcServices="Client" />
    </ItemGroup>

</Project>

The files are presents in my project:

But when I run a compilation, it fails with the error : objDebugnet8.0/ : error : No such file or directory

So I made the debugger more verbose, and here is the full logs from the ProtoCompile task:

Using “ProtoCompile” task from assembly “C:Usersxxx.nugetpackagesgrpc.tools2.65.0build_protobufnet45Protobuf.MSBuild.dll”.
Task “ProtoCompile”
C:Usersxxx.nugetpackagesgrpc.tools2.65.0toolswindows_x64protoc.exe –csharp_out=objDebugnet8.0 –plugin=protoc-gen-grpc=C:Usersxxx.nugetpackagesgrpc.tools2.65.0toolswindows_x64grpc_csharp_plugin.exe –grpc_out=objDebugnet8.0 –grpc_opt=no_server –proto_path=C:Usersxxx.nugetpackagesgrpc.tools2.65.0buildnativeinclude –proto_path=C:Usersxxx.nugetpackagestests.tests.testcodefirstgrpc1.0.262contentProtos –dependency_out=objDebugnet8.089b491885fed334d_GreeterServiceContract.protodep –error_format=msvs C:Usersxxx.nugetpackagestests.tests.testcodefirstgrpc1.0.262contentProtosGreeterServiceContract.proto
objDebugnet8.0/ : error : No such file or directory
The command exited with code 1.
Done executing task “ProtoCompile” — FAILED.
Done building target “_Protobuf_CoreCompile” in project “TestGrpc.csproj” — FAILED.

Here are some solutions I tried before posting:

  • The error appeared with an older version of the Grpc.Tools library, so I tried to update it to the latest, but nothing changed. The older version used to work before.
  • I tried to clear the Nuget Cache
  • I tried to restart my computer
  • I tried to run Visual Studio as an Administrator
  • I was not running the latest Visual Studio Community version so I updated to the latest (17.10.4)
  • I tried to recreate a new project from scratch on a newer solution, with the exact same csproj, and the error appears too
  • I tried to recreate manually the Protos/ dir and manually created the protofiles into it without the import of the nuget, and the Grpc tool is still giving me the same error
  • I tried to modify the path of the “Include” tag. Putting an incorrect path in the tag results in a successful compilation of the project, without any C# class generated. But when I use the correct path, it fails.

I’m running out of options to try, at this point I just want to completely uninstall the tool in case the issue is coming from it, but I don’t know how to do it.

Can you please help me to resolve this issue?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật