Visual Studio Error: "Unable to activate background task. Error activating background task."

When I try to run a specific background task using Visual Studio, I am currently getting the following error:

Cannot activate background task.  Background Task activation failed

I tried to click the Help button, which led me to How to trigger pause, resume, and background events in Windows Store apps . The page said that you were viewing a specific section in the event viewer that did not contain any entries.

The corresponding Windows Store application requests permission for the background job and registers the task. The application is included for the lock screen. The application project refers to the background task project, and its manifest indicates the correct fully qualified name of the background task class. The manifest indicates the type of background task you need.

+5
source share
3 answers

I was able to solve this by changing the registration code / location of the task to call RequestAccessAsyncbefore registering the background task. (He used to register a background job before requesting access.)

For some reason, this made the application request access again. After starting the application and giving it permission, I returned the code back to its previous state.

, , .

+1

, TaskEntryPoint , ... , !

, , !

, , , , typeof(LocationTask).FullName

+1

Visual Studio (2015) .

, , .

0

All Articles