我在空白的项目中运行下面的代码,并得到了“没有注册类(从HRESULT异常:0x80040154的(REGDB_E_CLASSNOTREG))”Geolocator.GetGeopositionAsync扔“类没有注册”异常C#
private Windows.Devices.Geolocation.Geolocator locator = new Windows.Devices.Geolocation.Geolocator();
private async void Button_Click(object sender, RoutedEventArgs e)
{
try
{
var position = await this.locator.GetGeopositionAsync();
}
catch (Exception ex)
{
//Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
}
}
而且,我试着运行Geolocation Sample 8.1(c#和JS),但得到了相同的异常,我试图在1台PC上运行此示例,而不是在1台网络上运行。全部都一样。 我的笔记本电脑上有win8.1 rtm和VS2013 RC。
此外,我运行此代码和微软样本在ARM平板8.1 rtm 8.1 Pro预览(与GNSS模块)和平板电脑(i5-3317U处理器和无GPS模块)。我没有得到这个例外,所有的工作都很好。所以我认为它只发生在PC/Simulator上。 如何在PC/Simulator上测试GeoLocation应用程序?
奇怪,它没有任何意义,“N和KN版本 N和KN版本中的功能与其等效的完整版本相同,但不包括Windows Media Player或其他Windows Media相关技术,例如Windows Media Center和Windows DVD Maker“。 –
我知道,但它是事实:)我有4个电脑和2个笔记本电脑赢得8.1 ** PRO N **从1个磁盘安装。所有这些代码都有例外。如果有人有Pro N - 也许可以运行这个代码并检查它。 – zedkommander
在msdn论坛上,一个人说他在Enterprise ** N **版本中重现了这个bug。 – zedkommander