Windows 8: Is app running inside Visual Studio?
Sometimes you need to run some additional debugging code when your app is launched from a development environment (e.g from Visual Studio), of course there are compiler directives for this but I’ve found a property inside WinRT that can make this even easier.
bool isInsideVs = Windows.ApplicationModel.Package.Current.IsDevelopmentMode;
please note that property indicates Development mode, this means that it will probably check whether app is running from \Program Files\WindowsApps folder so if you launch the just compiled app from Start menu on same machine it will still returns true.
Try to sideload the app and in this case it will have the value false.