jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

[Windows Phone 8.1 RT] Invalid Cast Exception with CrossDeviceInfo.Current.Id #273

Closed quentinR0bert closed 8 years ago

quentinR0bert commented 8 years ago

This is a

Which plugin does this impact:

Version Number of Plugin: 2.0.2 Device Tested On: Simulator Tested On: Emulator 8.1 WVGA 512 Mb

Expected Behavior

get the generated GUID

Actual Behavior

Sometimes the system returned to me :

Unable to cast object of type 'System.__ComObject' to type 'Windows.System.Profile.IHardwareIdentificationStatics'

With this StackTrace : at System.StubHelpers.StubHelpers.GetCOMIPFromRCW_WinRT(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget) at Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(IBuffer nonce) at Plugin.DeviceInfo.DeviceInfoImplementation.get_Id()

Steps to reproduce the Behavior

I ask for the CrossDeviceInfo.Current.Id at multiple times in the OnLaunched method of App.xaml.cs

(i resolved by stocked the id the first time now but i get this back to you if it can help you to improve this awesome plugin ^^)

jamesmontemagno commented 8 years ago

Moved to: https://github.com/jamesmontemagno/DeviceInfoPlugin/issues/3