Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

grpc
Dirk Maegh
#1 Posted : Sunday, March 13, 2022 6:11:02 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 33
Location: Belgium

Thanks: 6 times
Was thanked: 4 time(s) in 4 post(s)
Hi,

a few days ago I started experimenting with grpc.

I have followed a tutorial online, and decided to play with it.
I have setup a project to compile my proto file, and it contains server and client code.
To make things as simple as possible, I have *only* added this single proto file, and compiled it. No Problem.

Until I got to look at ncrunch which seems to have difficulty compiling the project.

Here's the project:
Quote:

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

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

<ItemGroup>
<None Remove="GreeterService.proto" />
</ItemGroup>

<ItemGroup>
<Protobuf Include="GreeterService.proto" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.18.0" />
<PackageReference Include="Grpc" Version="2.44.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.43.0" />
<PackageReference Include="Grpc.Tools" Version="2.44.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>


And here's the single proto file: (GreeterService.proto)
Quote:

syntax = "proto3";

service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}

message HelloRequest {
string name = 1;
}

message HelloReply {
string message = 1;
}


NCrunch gives the following feedback:
Could not make proto path relative (0, 0): GreeterService.proto: No such file or directory

Could you find why ncrunch gives me that feedback ? Am I doing something wrong ?

Thx,
Dirk
Remco
#2 Posted : Sunday, March 13, 2022 11:17:35 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,571

Thanks: 862 times
Was thanked: 1176 time(s) in 1097 post(s)
Hi Dirk,

Thanks for posting.

This would be because the build item 'ProtoBuf' is a custom build item that isn't in NCrunch's auto inclusion list.

You should be able to solve this by adding the .proto files to NCrunch's additional files to include setting so that NCrunch copies them to the workspace it uses to build this project.
Dirk Maegh
#3 Posted : Tuesday, March 15, 2022 6:38:58 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 33
Location: Belgium

Thanks: 6 times
Was thanked: 4 time(s) in 4 post(s)
Hi Remco,

indeed that fixed it.

Thx for your swift solution,
Dirk
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download