locked
Windows.Networking.BackgroundUploader gives HRESULT: 0x80040154(REGDB_E_CLASSNOTREG) error

    Question

  • I am trying to implement Windows.Networking.BackgroundUploader in a Windows Phone 8.1 Silverlight app, which I've read is now possible. However, when I call CreateUpload I get

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

    The Windows.Networking namespace is added fine and the project builds ok.

    If I create a new Windows Phone 8.1 Universal app, I can see that there are two 'Windows' references in the Object Browser, but in the Silverlight version only one is added and the Windows.Networking reference is missing. This looks like the cause of the error then. My question is, how do I add the 'right' reference to the Silverlight project? Or am I missing something else?

    Thanks in advance.

    Tuesday, October 14, 2014 9:10 AM

Answers

  • Interesting... your result prompted me to test again and now I see the call succeeding on both emulator and physical device.

    FWI, I did change some settings in the Package.appxmanifest at some point after my initial repro:

    I set: "Toast capable" to "Yes" , and checked the "internet (Client & Server)" option in Capabilities.

    The app project I was using also has "Background Tasks" in the Declarations section with "System event" checked although I don't remember adding that setting so it may be irrelevant.


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Wednesday, October 15, 2014 10:44 PM
    Moderator

All replies

  • I can reproduce this error but don't yet know the cause.

    One thing I do notice is that it works on emulator but not on a physical phone... do you see similar behavior?


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Tuesday, October 14, 2014 10:44 PM
    Moderator
  • Thanks for looking into this. No, I get it on the emulator and the device. I've also checked on any CPU, ARM and x86 builds - same issue on all.
    Wednesday, October 15, 2014 1:22 PM
  • Can you try it with the most recently released emulator images, ex: "Emulator 8.1 U1 WVGA 4 inch 512MB".


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Wednesday, October 15, 2014 2:03 PM
    Moderator
  • Sorry for the delay - trying to get my account verified so can post screenshots. In the meantime: 

    Have done I think - mine says "Emulator 8.1 WVGA 4 inch 512MB". I'm running VS 2013, update 3. The app is an upgrade from a Windows Phone 8 project created in VS 2012. I have tried in a new project created in VS 2013 and get the same error though.

    Wednesday, October 15, 2014 2:36 PM
  • Just found and installed Update 1 for the emulators and retested on Emulator 8.1 U1 WVGA 4 inch 512MB but get the same error...
    Wednesday, October 15, 2014 4:17 PM
  • Interesting... your result prompted me to test again and now I see the call succeeding on both emulator and physical device.

    FWI, I did change some settings in the Package.appxmanifest at some point after my initial repro:

    I set: "Toast capable" to "Yes" , and checked the "internet (Client & Server)" option in Capabilities.

    The app project I was using also has "Background Tasks" in the Declarations section with "System event" checked although I don't remember adding that setting so it may be irrelevant.


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Wednesday, October 15, 2014 10:44 PM
    Moderator
  • Are you sure you're testing in a Windows Phone 8.1 Silverlight app? I've only seen the Internet (Client & Server) capability in an RT/Universal app. In a Silverlight version the only capability is ID_CAP_NETWORKING. The manifest also does not have a Declarations section, only Requirements.

    This has got to be the issue then, but the documentation does say BackgroundUploader can be used in Silverlight apps...



    Thursday, October 16, 2014 8:28 AM
  • A Windows Phone 8.1 Silverlight app has both WMAppManifest.xml and Package.appxmanifest files. 

    When you upgrade a Windows Phone 8.0 Silverlight project to Windows Phone 8.1 it adds the file: "Package.appxmanifest" which contains the packaging requirements for Windows Phone 8.1 specific features. 

      For more details see http://msdn.microsoft.com/en-us/library/windows/apps/dn642081(v=vs.105).aspx


    Eric Fleck, Windows Store and Windows Phone Developer Support. If you would like to provide feedback or suggestions for future improvements to the Windows Phone SDK please go to http://wpdev.uservoice.com/ where you can post your suggestions and/or cast your votes for existing suggestions.

    Thursday, October 16, 2014 1:50 PM
    Moderator
  • It worked! Brilliant - thank you. Forgive my nooby error of not noticing Package.appxmanifest gets added to the project! So we have two manifest files now - interesting...

    "Background Tasks" and "System event" were already added and checked, so it was checking "Internet (Client & Server)" that did the trick I think. 

    I've tested this on a device, in the normal 8.1 emulators and Update 1 emulators.

    I will also answer my question on Stack Overflow here: http://stackoverflow.com/questions/26218480/windows-networking-backgrounduploader-gives-hresult-0x80040154regdb-e-classnot (unless you'd like to answer it and get some rep ;)



    Thursday, October 16, 2014 3:51 PM