This project has moved. For the latest updates, please go here.

MapControl.WinRT platform

Dec 9, 2012 at 5:35 PM

First, I'd like to thank you for this great project, it looks very promising!

I cloned your code and made a build and realized that MapControl.WinRT platform is X86, while some of the others any CPU.

Should WinRT version be compiled always to x86 platform or it can be changed? Are there any special reasons to target it to x86?

Thanks! 

Coordinator
Dec 9, 2012 at 6:42 PM

For WinRT projects, x86 seems to be the active platform by default when your machine is x86 (at least on my PC). You can simply switch to Any CPU in the project settings.

But i checked the other projects and realized that x86 was the only platform in the WpfApplication sample project. Fixed that.

Thanks for pointing that out.

Dec 9, 2012 at 7:00 PM

I pulled your changes and tried to build, set MapControl.WinRT platform to any CPU, but this way it can not be built, 198 error during building. Build for x86 is still ok.

Error 1 The type or namespace name 'Controls' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\Pushpin.Silverlight.WinRT.cs 8 22 MapControl.WinRTError 2 The type or namespace name 'Controls' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapItem.Silverlight.WinRT.cs 8 22 MapControl.WinRTError 3 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\Tile.cs 9 22 MapControl.WinRTError 4 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MatrixEx.cs 9 22 MapControl.WinRTError 5 The type or namespace name 'Controls' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\TileLayer.Silverlight.WinRT.cs 10 22 MapControl.WinRTError 6 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\TileImageLoader.Silverlight.WinRT.cs 10 22 MapControl.WinRTError 7 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapPanel.Silverlight.WinRT.cs 10 22 MapControl.WinRTError 8 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapOverlay.cs 10 22 MapControl.WinRTError 9 The type or namespace name 'Controls' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapItemsControl.cs 10 22 MapControl.WinRTError 10 The type or namespace name 'Controls' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\TileContainer.Silverlight.WinRT.cs 11 22 MapControl.WinRTError 11 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapPolyline.cs 11 22 MapControl.WinRTError 12 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\TileContainer.Silverlight.WinRT.cs 12 22 MapControl.WinRTError 13 The type or namespace name 'Media' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\MapBase.Silverlight.WinRT.cs 12 22 MapControl.WinRTError 14 The type or namespace name 'Markup' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) c:\Projektek\XAMLMapControl\MapControl\TileLayer.cs 13 22 MapControl.WinRT 
[...]

Coordinator
Dec 9, 2012 at 7:28 PM

Don't know... It works for me.

Dec 9, 2012 at 8:14 PM
Edited Dec 9, 2012 at 8:21 PM

May be it works, but it does not compile to any cpu, it compiles to x86 according to your settings. Check your compiled winrt binaries folder, there would be the compiled one in the ...x86 folder as an x86 binary and there will be no any cpu compiled one. Even if you change platform target. And if you change both the solution configuration and project build platform/platform target, you would get the build errors I wrote about.

Sorry to bothering you with this annoying thing, but my project is developed as an any cpu targeted one, and it has several other references by any cpu targeted libraries, so when I reference an x86 one, I get error/warning messages.

Dec 9, 2012 at 9:01 PM
Edited Dec 9, 2012 at 9:03 PM

I found the reason of the problem: when I switch to any CPU, condition compilation symbols NETFX_CORE;WINRT are removed from build settings. If I add it manually after switching, it compiles.

Coordinator
Dec 9, 2012 at 9:22 PM

I just realized the same after taking a closer look. Decided to remove the proprietary WINRT compiler directive and go with the pre-defined NETFX_CORE instead. Now "Any CPU" is the default target for WinRT projects also. Thanks again for pointing this out.