Null Exception was unhandled - IdleDetectionMode.Disabled

Whenever I debug an application for a Windows phone, whether on my phone or emulator, I always get this exception. How can I solve this problem?

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; 

I am still starting with this.

+7
source share
2 answers

This is no exception.

I think this is an exception, it is that PhoneApplicationService not created. So you get a NullReferenceException .

Either add PhoneApplicationService = new PhoneApplicationService() to the line above, or make sure the following XAMLs are in your App.xaml

 <Application.ApplicationLifetimeObjects> <!--Required object that handles lifetime events for the application--> <shell:PhoneApplicationService Launching="Application_Launching" Closing="Application_Closing" Activated="Application_Activated" Deactivated="Application_Deactivated"/> </Application.ApplicationLifetimeObjects> 
+11
source

I had the same problem. Clearing the \ bin and \ obj folders and then recompiling resolved for me.

+51
source

All Articles