UnityContainer的创建失败

时间:2015-03-21 16:15:08

标签: android xamarin xamarin.forms

使用NuGet我将Unity添加到我的Xamarin.Forms应用程序中 在我的App类构造函数中,我想要新建一个UnityContainer实例。

using Xamarin.Forms;
public class App : Application
{
    public App ()
    {
        unityContainer = new UnityContainer();

        // The root page of your application
        this.MainPage = new NavigationPage(new HomePage()); 
    }

    private static IUnityContainer unityContainer;        
 }

不幸的是,当我开始在Android模拟器中运行我的应用程序时,System.Reflection.TargetInvocationException.被抛出unityContainer = new UnityContainer();行。 这可能是什么原因?

0 个答案:

没有答案