Windows Store app crash when adding Bing maps to the page

0

I created new Universal app (Hub Template) on my VS 2013, and followed this article about adding Bing maps to my app: http://msdn.microsoft.com/en-us/library/hh855146.aspx

my 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>

the app crashs on the launch with this native exception:

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

Without the Bing Maps control of course the app don't crash... Anyone knows what the problem? I just wanted to do somthing simple.

c#
windows-8.1
bing-maps
win-universal-app
asked on Stack Overflow Sep 26, 2014 by Rom Shiri

1 Answer

0

The Bing Maps control only works in Windows 8/8.1 apps. To use maps in universal apps take a look at this blog post: http://rbrundritt.wordpress.com/2014/06/24/how-to-make-use-of-maps-in-universal-apps/

Another thing to check is that you have changed the active solution platform from Any-CPU to x86 or x64 in configuration manager. The Bing Maps control makes use of the C++ runtime and that requires that you build the project against specific platforms rather than using the Any-CPU setting. You can find documentation on this here: http://msdn.microsoft.com/en-us/library/dn456475.aspx

answered on Stack Overflow Sep 27, 2014 by rbrundritt

User contributions licensed under CC BY-SA 3.0