PrismLibrary / PrismLibrary/Prism
[BUG] Keyed services not supported
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.8k
- Forks
- 1.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 1
Description
Description
App crashes if a BottomSheet is opened with exception "Keyed services not supported". I'm using the Prism.DryIoc container.
It works with Microsofts container.
Steps to Reproduce
-
Run the App and click on button "Open bottom sheet"
-
Application crashes
-
Remove
UsePrismfrom MauiProgram -
Add
builder.Services.AddBottomSheet<PageA>("PageA");in MauiProgram -
Add in App.xaml.cs
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new NavigationPage(new MainPage(Handler.GetService<IBottomSheetNavigationService>())));
}
- Run the app and click the button
Platform with bug
.NET MAUI
Affected platforms
Android, I was not able test on other platforms
Did you find any workaround?
No response
Relevant log output
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached MauiApp1 reproduction and compare the Prism.DryIoc setup in MauiProgram with the Microsoft container setup described in the steps. Trace the BottomSheet registration and the call from App.xaml.cs, then reproduce the crash on Android. Done means opening the bottom sheet succeeds when UsePrism is enabled without the keyed-services exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100