PrismLibrary / PrismLibrary/Prism

[BUG] Keyed services not supported

Open
#3,317 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocked by platform bug containers
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

MauiApp1.zip

  1. Run the App and click on button "Open bottom sheet"

  2. Application crashes

  3. Remove UsePrism from MauiProgram

  4. Add builder.Services.AddBottomSheet<PageA>("PageA"); in MauiProgram

  5. Add in App.xaml.cs

protected override Window CreateWindow(IActivationState? activationState)
{
    return new Window(new NavigationPage(new MainPage(Handler.GetService<IBottomSheetNavigationService>())));
}
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.