admin管理员组文章数量:1277362
I'm trying to get Aspire to run up a C# (.NET 8) project that exposes a DAPR service that uses gRPC. Another service will then use InvokeMethodGrpcAsync to call the service. Aspire throws this error:
The endpoint 'grpc' is not allocated for the resource '{project-name}'
This Aspire config is being used:
builder.AddProject<Projects.InternalAlpha>("Internal-Alpha")
.WithDaprSidecar(new DaprSidecarOptions()
{
AppId = "internal-alpha",
AppPort = 5021,
DaprHttpPort = 54021,
DaprGrpcPort = 54022,
AppProtocol = "grpc",
LogLevel = "debug",
});
Aspire doesn't seem to like AppProtocol
being set, and generates the exception for the sidecar:
Failed to create resource Internal-Alpha-dapr-cli
System.InvalidOperationException: The endpointgrpc
is not allocated for the resourceInternal-Alpha
.at Aspire.Hosting.ApplicationModel.EndpointReference.get_AllocatedEndpoint() in //src/Aspire.Hosting/ApplicationModel/EndpointReference.cs:line 105
at Aspire.Hosting.ApplicationModel.EndpointReference.get_Host() in //src/Aspire.Hosting/ApplicationModel/EndpointReference.cs:line 87
at Aspire.Hosting.Dapr.DaprDistributedApplicationLifecycleHook.<>c__DisplayClass6_1.b__11(IList1 updatedArgs) in /_/src/Aspire.Hosting.Dapr/DaprDistributedApplicationLifecycleHook.cs:line 218 at Aspire.Hosting.ApplicationModel.CommandLineArgsCallbackAnnotation.<>c__DisplayClass1_0.<.ctor>b__0(CommandLineArgsCallbackContext c) in /_/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs:line 32 at Aspire.Hosting.Dcp.ApplicationExecutor.CreateExecutableAsync(AppResource er, ILogger resourceLogger, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 1316 at Aspire.Hosting.Dcp.ApplicationExecutor.<CreateExecutablesAsync>g__CreateResourceExecutablesAsyncCore|62_0(IResource resource, IEnumerable
1 executables, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/ApplicationExecutor.cs:line 1222
- The app
Internal-Alpha
starts up and runs without warnings - The latest Aspire workload is installed, and all packages are latest
- With the same settings, the project/sidecar runs up ok with docker compose and works as expected
What is the correct Aspire configuration?
本文标签:
版权声明:本文标题:c# - Dotnet Aspire project with DAPR sidecar using gRPC, setting AppProtocol throws exception - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741266373a2368545.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论