Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) when trying to register a background task windows phone 8.1

When i trying to register a background task in windows phone 8.1 insted of this sample http://code.msdn.microsoft.com/windowsapps/Tile-Update-every-minute-68dbbbff i got this error :

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

i use this code :

Dim taskBuilder As New BackgroundTaskBuilder()
taskBuilder.Name = taskName
taskBuilder.TaskEntryPoint = taskEntryPoint
taskBuilder.SetTrigger(New SystemTrigger(SystemTriggerType.UserPresent, False))
taskBuilder.Register()

Any help please ?

like image 823
Muhamed AlGhzawi Avatar asked May 20 '14 07:05

Muhamed AlGhzawi


2 Answers

Make sure your taskEntryPoint variable value matches the Entry point: value you have defined in Package.appmanifest >>> Declarations >>> Background Tasks >>> Entry point.

like image 147
Rob.Kachmar Avatar answered Oct 13 '22 19:10

Rob.Kachmar


I found the answer (for me). I didn't pay attention to capitalization in my declaration in the Package.appmanifest. In there I set the entry point as Projectname.ClassName and when I was SetTrigger in code, I set it as ProjectName.ClassName.

My what a difference a letter makes!

like image 42
user3723700 Avatar answered Oct 13 '22 20:10

user3723700