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

Fix Previewer crash from Refit reflection (#14282) #14301

Merged
merged 1 commit into from Jan 22, 2024

Conversation

mayka-mack
Copy link
Contributor

What does the pull request do?

Due to its use of reflection, invoking Refit causes the Previewer to crash, since Assembly.LoadFile doesn't make the app's assembly available for reflection within the context of the Previewer. Therefore, Refit's reflection-based generator fails. See reactiveui/refit#1476 for more details.

What is the current behavior?

Using Refit causes the Previewer to crash.

What is the updated/expected behavior with this PR?

The app assembly is now available for reflection within the context of the Previewer, so the Previewer will not crash.

How was the solution implemented (if it's not obvious)?

Changes the Avalonia previewer's Assembly.LoadFile usage to Assembly.LoadFrom.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #14282

@mayka-mack
Copy link
Contributor Author

@dotnet-policy-service agree

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0043827-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0043833-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@mayka-mack mayka-mack marked this pull request as ready for review January 22, 2024 01:03
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Jan 22, 2024
@maxkatz6 maxkatz6 added this pull request to the merge queue Jan 22, 2024
Merged via the queue into AvaloniaUI:master with commit a412c8d Jan 22, 2024
6 checks passed
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash within designer when using Refit
3 participants