2014-09-26 80 views
0

,当我在我的VS 2013中创建新的通用应用程序(集线器模板),并遵循有关添加Bing地图,以我的应用程序的这篇文章: http://msdn.microsoft.com/en-us/library/hh855146.aspxWindows应用商店的应用程序崩溃添加Bing地图页面

我的XAML:

<Page 
x:Name="pageRoot" 
x:Class="HubApp1.HubPage" 
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:HubApp1" 
xmlns:data="using:HubApp1.Data" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:bm="using:Bing.Maps" 
mc:Ignorable="d"> 

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
    <bm:Map x:Name="myMap" Credentials="MY_SHARD_KEY" ></bm:Map> 
</Grid> 

上推出的应用程序crashs本机异常:

Unhandled exception at 0x76ECB152 (combase.dll) in HubApp1.Windows.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x002ED480, 0x00000002). 

没有Bing Maps控件当然应用程序不会崩溃... 任何人都知道什么问题?我只想做简单的事情。

回答

0

必应地图控件仅适用于Windows 8/8.1应用程序。要在通用应用程序中使用地图,请阅读以下博客文章:http://rbrundritt.wordpress.com/2014/06/24/how-to-make-use-of-maps-in-universal-apps/

另一件要检查的问题是,您已将配置管理器中的活动解决方案平台从Any-CPU更改为x86或x64。 Bing Maps控件使用C++运行时,并且需要您针对特定平台构建项目,而不是使用Any-CPU设置。你可以在这里找到这方面的文档:http://msdn.microsoft.com/en-us/library/dn456475.aspx

相关问题