Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Problem with prism modules and dependency injection on iOS if using "Link All" - can anybody help?

$
0
0

Hello,

I am using the modules of prism.

On Android, Win8.1, WinPhone8.1 and UWP the app works fine.

On iPhone Simulator too.

If I want to start the app on a real iPhone (Device) I must change the "Linker Options" of the ios-project to "Link all assemblies". Next step was to preserve some dlls from linking:
--linkskip=Microsoft.Practices.Unity --linkskip=Prism --linkskip=Prism.Unity.Forms --linkskip=Prism.Forms --linkskip=Microsoft.Practices.ServiceLocation

Now the application throws this error:

Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Dvb.MobileCatalog.Module.KatalogPages.KatalogPagesModul", name = "(none)".

Exception occurred while: while resolving.

Exception is: InvalidOperationException - The type KatalogPagesModul does not have an accessible constructor.


At the time of the exception, the container was:

Resolving Dvb.MobileCatalog.Module.KatalogPages.KatalogPagesModul,(none)

I think, the app can not resolve the dependecy-injection I use in KatalogPagesModul (as shown in the examples from prism):

    public class KatalogPagesModul : IModule
    {
        private readonly IUnityContainer _unityContainer;

        public KatalogPagesModul(IUnityContainer unityContainer)
        {
            this._unityContainer = unityContainer;
        }

        public void Initialize()
        {
            _unityContainer.RegisterTypeForNavigation<HomePage>(PageNames.HomePage);
            _unityContainer.RegisterTypeForNavigation<KatalogPage>(PageNames.KatalogPage);
            _unityContainer.RegisterTypeForNavigation<ArtikelListePage>(PageNames.ArtikelListePage);
        }

    }

Can anybody help me to solve the problem?


Viewing all articles
Browse latest Browse all 204402


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>