dapr / dapr/dotnet-sdk

Feature: Support AOT across Dapr clients

Open
#1,447 3 comments 0 reactions 0 assignees View on GitHub
area/client kind/enhancement
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

## Expected Behavior
In a project where subscriptions are made via the bus using .WithTopic("name", nameof(class)), I would like the MapSubscribeHandler to work correctly in AOT (Ahead-Of-Time) mode.
Currently, it seems that AOT is not fully supported in this scenario, which leads to issues when using Dapr with this pattern. It would be great if this functionality could be improved to support AOT seamlessly.

## Actual Behavior
At startup, the application throws the following error, which I believe is related to the Subscription class in the following line of code:
https://github.com/dapr/dotnet-sdk/blob/master/src/Dapr.AspNetCore/DaprEndpointRouteBuilderExtensions.cs#L189

![Image](https://github.com/user-attachments/assets/a293b9f4-e2ec-489c-b3d9-0a3fb6b1be18)

## Steps to Reproduce the Problem
=> Project c# 9 aot
=> Juste add enpoint with WithTopic
=> and use compoenent type: pubsub.rabbitmq
=> Start service

## Release Note
RELEASE NOTE: **FIX** support AOT when subscribing with the bus

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.