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

7.0.0.336-pre not resolving NavigationPage #1311

Closed
Bjselous opened this issue Dec 22, 2017 · 2 comments
Closed

7.0.0.336-pre not resolving NavigationPage #1311

Bjselous opened this issue Dec 22, 2017 · 2 comments

Comments

@Bjselous
Copy link

I upgraded to 7.0.0.336-pre and the project now throws the following exception on startup:

DryIoc.ContainerException: Unable to select single public constructor from implementation type Xamarin.Forms.NavigationPage:
Void .ctor(),
Void .ctor(Xamarin.Forms.Page)
at DryIoc.Throw.It(Int32 error, Object arg0, Object arg1, Object arg2, Object arg3)
at DryIoc.ReflectionFactory.ThrowIfInvalidRegistration(Type serviceType, Object serviceKey, Boolean isStaticallyChecked, Rules containerRules)
at DryIoc.Container.Register(Factory factory, Type serviceType, Object serviceKey, IfAlreadyRegister

This behavior appears to be related to NavigationPage only because if I edit App.xml.cs as follows:

` public App(IPlatformInitializer initializer) : base(initializer) { }

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {
        //containerRegistry.RegisterForNavigation<NavigationPage>();
        containerRegistry.RegisterForNavigation<MainPage>();
    }

    protected override async void OnInitialized()
    {
        InitializeComponent();
        
       //await NavigationService.NavigateAsync("NavigationPage/MainPage"); 
        await NavigationService.NavigateAsync("MainPage");
    }` 

This will load MainPage without issues.

Is this a bug or am I missing something when I upgrade to 7.0.0.336-pre?

Package info

  • Platform: UWP (throws DryIoc.ContainerException: Unable to select single public constructor from implementation type ),
    Android (throws DryIoc.ContainerException: ) and
    iOS (throws DryIoc.ContainerException: Unable to select single public constructor from implementation type )
  • Prism version:7.0.0.336-pre
  • Xamarin version (if applicable): Xamarin.Forms 2.5.0.121934
  • Windows 10 SDK version (if applicable): 16299
  • Other version info: DryIoc 2.12.5

Repro steps

  1. Create new project using prism template pack version 2.0.7 (latest)
  2. Update nugets ()
  3. Update Prism.DryIoc.Forms to 7.0.0.336-pre
  4. Refactor to import IPlatformInitializer and implement RegisterTypes(IContainerRegistry containerRegistry)
  5. Refactor page registration containerRegistry.RegisterForNavigation();

Run.

Expected behavior: App runs, NavigationPage resolved.
Actual behavior: Exception on startup DryIoc.ContainerException: Unable to select single public constructor from implementation type

@dansiegel
Copy link
Member

this is a duplicate of #1304. You can use the package in the CI feed for the fix to this issue.

@lock
Copy link

lock bot commented Jan 29, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants