BNS error. The maximum number of ScheduledActions of this type have already been added.

In setting up a PeriodicTask in my Windows Phone 8 project, I ran into an error while debbugging: BNS error. The maximum number of ScheduledActions of this type have already been added. This occurs when there is already a PeriodicTask for the application and another one is added (only 1 PeriodicTask is allowed per application). To fix this, I found there are two solutions. The first (which I don’t like) is to find the PeriodicTask by the same name and remove it:

A better implementation is to iterate through all PeriodicTasks for the application removing them:

This entry was posted in it and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>