Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoints containing sagas fail to start when a scanned assembly contains a ref struct #7195

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

andreasohlund
Copy link
Member

Backport of #7187 which fixes #7179 for the release-8.2 branch

* Prevent saga conventions from throwing on ref struct

* Better test

* Tweaks

---------

Co-authored-by: Mike Minutillo <mike.minutillo@particular.net>
@andreasohlund andreasohlund added this to the 8.2.4 milestone Oct 28, 2024
@andreasohlund andreasohlund self-assigned this Oct 28, 2024
@@ -104,6 +106,13 @@ static bool IsCompatible(Type t, Type source)

static bool IsTypeATimeoutHandledByAnySaga(Type type, IEnumerable<Type> sagas)
{
// MakeGenericType() throws an exception if passed a ref struct type
// Messages cannot be ref struct types
if (type.GetCustomAttribute<IsByRefLikeAttribute>() != null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreasohlund andreasohlund merged commit 91c73f5 into release-8.2 Oct 29, 2024
3 checks passed
@andreasohlund andreasohlund deleted the backport-refstruct-82 branch October 29, 2024 12:09
@poornimanayar poornimanayar changed the title Ref struct in scanned assembly results in app crash at startup, if sagas are present Endpoints containing sagas fail to start when a scanned assembly contains a ref struct Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants