Xamarin Native Dependency reference problems

I have a xamarin.native app that has the following layers:

  • Android UI Layer
  • iOS UI Layer
  • Domain Layer
  • Infrastructure Layer
  • IoC Layer

I'm using simple injector as my IoC and I've noticed that as I start to setup my IoC I get the following build error:

Can not resolve reference some.reference, referenced by MyMobileApp.IoC > MyMobileApp.Infrastructure.Please add a NuGet package or assembly reference for 'some.reference', or remove the reference to MyMobileApp.IoC`.

Here is how I'm registering the IoC on the UI layer for Android:

`[Application]
public class App : Application
{
public static readonly Container Container = new Container();

public App(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer)
{
}

public override void OnCreate()
{
    base.OnCreate();

    Initialize();
}

private static void Initialize()
{
    // these are static methods from the IoC layer.
    Container.RegisterRepositories();
    Container.RegisterMockService();
    Container.RegisterCacheService();
}

}`

If I add the nuget package I'm using on the infrastructure layer to my UI layers, it resolves the error but that seems wrong to me as I never had to do that with a web or console app, so I'm a little puzzled on what I'm doing wrong.

the Domain, Infrastructure, and IoC layers are all Netstandards if that makes a difference.

Best Answer

  • XamarinNewcomerXamarinNewcomer US ✭✭
    Accepted Answer

    after banging my head on this, I'm just going to succeed and just installed whatever it's complaining about, I'm not finding much resources on things to steer me in the right direction

Answers

  • XamarinNewcomerXamarinNewcomer USMember ✭✭
    Accepted Answer

    after banging my head on this, I'm just going to succeed and just installed whatever it's complaining about, I'm not finding much resources on things to steer me in the right direction

Sign In or Register to comment.