MVVM Light “Type Not Found in cache”

前端 未结 2 398
情书的邮戳
情书的邮戳 2021-01-11 15:44

I\'m trying to convert my Windows Phone 8 Silverlight application to an 8.1 Phone app as part of a universal app. I don\'t know if thats relevant because this is the first t

2条回答
  •  庸人自扰
    2021-01-11 16:13

    In my case, the target class didn't implement a parameter-less constructor. The only constructor that the class contained accepted a byte type parameter, so I was getting:

    Type not found in cache: System.Byte

    My registration line was like this:

    SimpleIoc.Default.Register();
    

    I added a parameter-less constructor to MyConcreteClass and then applied [PreferredConstructor] attribute to it (this attribute is available in GalaSoft.MvvmLight.Ioc namespace) and got rid of the issue.

    Hope this helps someone down the road.

提交回复
热议问题