c# - WP7.1 System.NotSupportedException: "LaunchForTest is not supported" -
i writing windows phone application using visual studio 2012 , wp8 sdk target windows phone os version set windows phone os 7.1. mode debug , testing using sdk shipped "emulator 7.8" (same results "emulator 7.1" , wp8 emulator or on wp7.8 device).
my code follows:
#if debug public void test() { if (scheduledactionservice.find(remindername) != null) { try { scheduledactionservice.launchfortest(remindername, timespan.fromseconds(1)); } catch (notsupportedexception e) { system.diagnostics.debug.writeline(e.message); system.diagnostics.debug.writeline(e.tostring()); } } else { messagebox.show("no scheduled notification has been installed"); } } #endif after invoking method via button following debug output:
a first chance exception of type 'system.notsupportedexception' occurred in microsoft.phone.dll launchfortest not supported system.notsupportedexception: launchfortest not supported @ microsoft.phone.scheduler.scheduledactionservice.launchfortest(string name, timespan delay) @ ringreminder.control.ringagent.test() i @ loss here, since scheduledactionservice.launchfortest method states: windows phone os | supported in: 8.0, 7.1.
searching problem on or google didn't bring either.
thanks help
remindername sounds it's of type reminder. reminder class derives schedulednotification class, not scheduledtask class. notsupportedexception thrown in launchfortest method when supplied object not of scheduledtask object. that's why you're getting exception, because reminder object not of type scheduledtask.
Comments
Post a Comment