Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
265 views
in Technique[技术] by (71.8m points)

xamarin.uwp - hockeyapp throws exception on UWP in xamarin.forms application

I was using hockeyapp successfully in android and ios when I now try to use it uwp application on emulator and local win10 machine. It throws as exception for missing " 'Windows.System.Profile.HardwareIdentification'.":"Windows.System.Profile.HardwareIdentification""

my UWP version is as below

enter image description here

my application is an xamarin.forms application. here is what I installed

  • XF proj: HockeySDK.Xamarin, HockeySDK.Core
  • UWP proj: HockeySDK.Core, HockeySDK.UWP

In the constructor of MainPage.xaml.cs in UWP project I have added

 Microsoft.HockeyApp.HockeyClient.Current.Configure(HockeyAppID);

in XF project within try catch functions I fire TrackException as below

catch (Exception ex)
                {
                Dictionary<string, string> properties = new Dictionary<string, string>();
                properties.Add(key, value);
                Microsoft.HockeyApp.HockeyClient.Current.TrackException(ex, properties);
                }

when I search for it, I only find posts like this one which shows how to get HardwareIdentification but I thought hockeyapp should fetch it for me and it does on android. what is wrong with UWP? Do I have to do it myself if yes where should I pass this information? Or could be that something is wrong with my win10 installation :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I finally found an answer to my question. although my uwp was cofigured with min and max version as in the image and I had sdk 14393 was installed. enter image description here

obviously it is not enough. if you dont have SDK. Released November 2015. (Version 10.0.10586.212), there will be no file generated for Windows.System.Profile.ProfileHardwareTokenContract.winmd as shown in the image below. once I installed this sdk as well, file was successfully created.

This file looks like necessary using hockeyapp, xamarin insight, application insight etc. because they need to identify the device. It is also necessary later when you want to ship your app to the windows store. I hope that this helps some people

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...