none
Lumia Imaging SDK and PubCenter on WP8.1 RT : System.TypeLoadException

    Question

  • Hello, i'm developping a WP8.1 RT app using the Lumia imaging SDK for 8.1 and it's working like a charm. Recently, I had to put some PubCenter ads on my layout. When navigating to a page that is making calls to Imaging library, I catch an exception : "Requested Windows Runtime type 'Lumia.Imaging.RandomAccessStramingImageSource' is not registered".

    I tried reinstalling the Imaging SDK through nuget. The only way to make my code work again is to delete the reference 'Microsoft Advertising SDK for Windows Phone 8.1 (XAML)'.

    I also tried to add this reference on a Lumia Imaging Sample from the official website, same problem but on different methods from the Lumia.Imaging namespace.

    Do you guys already experienced this kind of errors ? Is PubCenter known to work with the Lumia Imaging SDK ? If not, is there any other good ad provider on WP8.1 RT (since Admob is no longer supported...)

    Friday, December 26, 2014 10:33 AM

All replies

  • Hi Strapsoft - this sounds like a problem in the Advertising SDK. However, if you can post a sample project that has this problem to OneDrive and share it here, I'll check it out.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, December 29, 2014 2:58 PM
    Moderator
  • This looks like is a Visual Studio 2013 update 4 issue, or if you are using Community Edition which includes this update. 

    The "Requested Windows Runtime type <class> is not registered" exception is caused by that fact that the appxmanifest is file is not correctly generated in VS2013 update 4. There is a bug in Microsoft.Build.AppxPackage.dll, creating an incomplete list of classes to be registered. This is supposed to be fixed in VS2013 update 5.

    Workaround:
    Replace the AppxPackage files with VS2013 update 3 version. 
    - Microsoft.AppxPackage.Targets
    - Microsoft.Build.AppxPackage.dll

    Replace the two files located at VS2013 installation path (e.g. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\ ) with the update 3 version. 

    The update 3 files are available here (patch.zip):
    https://onedrive.live.com/redir?resid=99B45FF02D12B84D!60194&authkey=!ACQoovyOLV-_7LQ&ithint=file%2czip 


    Hope this helps!


    Tuesday, January 13, 2015 10:23 AM