You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does the bug reproduce also in WPF for .NET Framework 4.8?: No
Problem description:
Trying to use a gRPC service as shown in the AspNetDocs-repo in a WPF app, <UseWPF>true</UseWPF>, results in a build error. Visual Studio and VSCode does not report the problem in intellisense but it appears when doing a dotnet build .sln.
Actual behavior:
Results in a
error CS0246: The type or namespace name 'Greet' could not be found (are you missing a using directive or an assembly reference?)
When building. Greet here is the gRPC service defined in a .proto file.
The text was updated successfully, but these errors were encountered:
hayer
changed the title
Code Issues 186 Pull requests 25 Projects 0 Wiki Security Insights Fails to build when trying to use the AspNetCore gRPC
Fails to build when trying to use the AspNetCore gRPC
Jun 3, 2019
The problem here is that DemoWpfApp is using the Microsoft.NET.Sdk.WindowsDesktop. I'm not familiar with this SDK but it seems like it's not importing the props/targets files of the package dependencies. Hence the code generation targets of Grpc.Tools are not being run and hence why there are missing types during compilation. I see that the DemoService compile successfully because the Microsoft.NET.Sdk.Web that it uses imports the correct props/targets files. @shirhatti, do you know who might be more knowledgeable about the Microsoft.NET.Sdk.WindowsDesktop SDK?
Ah I see they came to the same conclusion in the related issue. This seems to be a WPF issue where the gRPC targets are not being picked up due to the package reference not being propagated to the temp project. There's nothing to fix on our side so I'll close this now.
Hi @JunTaoLuo ,
I had same issue. So I added a new class library project to the solution the I add proto files to it and after that I add the new project as a project reference to the main project. This way I resolved the issue
.NET Core Version: 3.0-preview5
Windows version: Windows 10, 1903
Does the bug reproduce also in WPF for .NET Framework 4.8?: No
Problem description:
Trying to use a gRPC service as shown in the AspNetDocs-repo in a WPF app,
<UseWPF>true</UseWPF>
, results in a build error. Visual Studio and VSCode does not report the problem in intellisense but it appears when doing adotnet build .sln
.Actual behavior:
Results in a
When building.
Greet
here is the gRPC service defined in a.proto
file.Expected behavior:
Build & run with no error.
Minimal repro:
I made a repro-repo here.
Re-post of issue created at dotnet/wpf#810.
The text was updated successfully, but these errors were encountered: