【问题标题】:TinyIoC.TinyIoCResolutionException: Unable to resolve type: on ipad deploymentTinyIoC.TinyIoCResolutionException:无法解析类型:在 ipad 部署中
【发布时间】:2013-11-16 14:41:23
【问题描述】:

我收到 TinyIOC 无法解析类型异常。我已经使用 Xamarin studio for ipad 开发了我的应用程序。在模拟器中它工作正常。但是在部署 ipad 时,我遇到了错误。

TinyIoC.TinyIoCResolutionException:无法解析类型:IOSLoginViewModel ---> System.Exception:无法解析类型:IOSLoginViewModel ---> System.Exception:无法解析类型:

private IEnumerable<ConstructorInfo> GetTypeConstructors(Type type)
    {
        //#if NETFX_CORE
        //          return type.GetTypeInfo().DeclaredConstructors.OrderByDescending(ctor => ctor.GetParameters().Count());
        //#else
        return type.GetConstructors().OrderByDescending(ctor => ctor.GetParameters().Count());
        //#endif
    }

上述方法在模拟器上返回值,但对于 ipad,它给出了 null。

我使用的代码行是

var tContainer = TinyIoC.TinyIoCContainer.Current;
tContainer.Register<IOnlineAuthenticationService, Framework.OnlineProvider.AuthenticationService>().AsMultiInstance(); 


DataContext = TinyIoC.TinyIoCContainer.Current.Resolve<IOSLoginViewModel>();

IOS Build options 我都试过了, 链接 - SDK, ALL, No 但仍然是同样的错误。

【问题讨论】:

    标签: xamarin.ios tinyioc


    【解决方案1】:
    1. 在 Xamarin Studio 中,打开“运行”->“异常”并添加“System.Exception”。 运行你的
    2. 运行你的应用程序
    3. 发生错误时,请查看异常对象的 InnerException 属性,该属性将为您提供无法解析类型的线索。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-31
      • 1970-01-01
      • 2015-10-22
      • 1970-01-01
      • 2013-12-14
      • 1970-01-01
      • 2017-07-19
      相关资源
      最近更新 更多