2

我得到 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 构建选项我已经尝试了所有,链接 - SDK,全部,没有但仍然相同的错误。

4

1 回答 1

6
  1. 在 Xamarin Studio 中,打开“运行”->“异常”并添加“System.Exception”。运行你的
  2. 运行你的应用程序
  3. 发生错误时,请查看异常对象的 InnerException 属性,该属性将为您提供无法解析类型的线索。
于 2013-11-15T16:17:27.917 回答