dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.58k stars 25.29k forks source link

Type or namespace Api does not exist in 'Google' #30156

Open Leonardo-Ferreira opened 1 year ago

Leonardo-Ferreira commented 1 year ago

I did as instructed by im getting this error here, but, when compiling the solution I get the erro Error: The type or namespace name 'Api' does not exist in the namespace 'Google' (are you missing an assembly reference?)

any ideia of what im doing wrong?!?

image


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

wadepickett commented 1 year ago

@Leonardo-Ferreira, thanks for taking the time to relate your experience with the doc.
This issue is filed on the .NET 7 version of the topic. Were you working with .NET 7 and Visual Studio 2022, or was it actually .NET 8 Preview? (also available for this doc) I will test through them.

You can compare your project to the .NET 7 or .NET 8 samples for this tutorial, located here and look for a diff: https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/grpc/json-transcoding/sample

Leonardo-Ferreira commented 1 year ago

.Net 7 (SDK 7.0.10) and Visual Studio for Mac version 17.6.3 (build 421)

Leonardo-Ferreira commented 1 year ago

Any news @wadepickett?

vishm commented 10 months ago

@Leonardo-Ferreira Trust you found your solution - I hit this same issue when pulling out the Protos into a shared project. Once I added the NuGet package - "Google.Api.CommonProtos" all worked fine. Just adding this info here for other souls.

zeecorleone commented 4 months ago

in my dotnet 8 client application, I have added NuGet Google.Api.Gax.Grpc and it resolved this compilation error.