MSAF In a Windows Phone 7 triggers location

Oct 30, 2010 at 3:43 PM


My first WP7 application has just been accepted and It uses MSAF to report to Google Analytics. The problem is that even if capability ID_CAP_LOCATION is NOT in my WMAppManifest.xml and the  capabilities tool from Windows Phone Developer Tools October 2010 Update only reports ID_CAP_NETWORKING and ID_CAP_WEBBROWSERCOMPONENT, Zune and the Marketplace asks before installing the App about allowing it to access the Phone Location.


I've seen a Behavior called "TrackLocation", that I'm not using, that makes me think that MSAF is causing this problem. Can it be disabled or removed? It's a show stopper for apps that DON'T need Localization...

Oct 30, 2010 at 6:20 PM
Edited Oct 30, 2010 at 6:39 PM

We are working on a new build 1.4.8 that removes the dependency on ID_CAP_LOCATION and ID_CAP_MEDIALIB from Microsoft.WebAnalytics and Microsoft.WebAnalytics.Behaviors.  We don't have a release date scheduled yet but the source code is checked in and you can download it today to build the MSAF.


Oct 30, 2010 at 11:33 PM

Cool, thanks. MSAF works like a charm and it's very easy to implement, what I don't understand is that WP7 SDK doesn't warn you about this before submission. Heck, it should even throw an exception or something if we try to access (even from external libraries) without the capabilities enabled...

Oct 31, 2010 at 12:03 AM

There is a new Capability Detection tool in the Windows Phone Developer Tools October update that you can run to determine the capabilities of a DLL or Xap files.  Here is a post build step that I added to my WP7 project to list the capabilities that are explicitly needed for an application:

set CAPDETECT=%ProgramFiles(x86)%\Microsoft SDKs\Windows Phone\v7.0\Tools\CapDetect\
@echo Detecting Capabilities of "$(ProjectDir)$(ConfigurationName)"
CapabilityDetection.exe Rules.xml "$(ProjectDir)Bin\$(ConfigurationName)"

You can download the update here if you already have the tools installed.