question

JanDrozd-9035 avatar image
0 Votes"
JanDrozd-9035 asked JanDrozd-9035 edited

[UWP] PlayReady crashes whole app when iterating licenses in release configuration

Hi to all!

Once more, I've strange behavior of UWP application I develop I would like to ask help with. Below is the code I use to get information about licenses present on device.

That code works nicely, when I debug the app in Visual Studio 2019. I can see all the license details. However, when I build my application in Release configuration (for MS Store) the code causes crash.

  • Application crashes without any stack trace. The only available information is in event viewer (see bottom)

  • Using try/catch block in following code does not affect behavior. It crashes the app anyway

  • By debugging I've found that it crashes when this line is called: var licenses = new PlayReadyLicenseIterable();

  • However to crash application, at least one PlayReady license must be acquired (if there's no license acquired, the app won't crash)



       internal static string GetPlayreadyLicensesDebugInfo()
                 {
                     string result = "";
            
                     var licenses = new PlayReadyLicenseIterable();
            
                     if (licenses != null)
                     {
                         foreach (var license in licenses)
                         {
                             if (license != null)
                             {
                                 string kid = license.GetKIDAtChainDepth(0).ToString();
            
                                 result += "Chain depth: " + license.ChainDepth.ToString() + "\r\n";
                                 result += "KeyID: " + kid + "\r\n";
                                 result += "Expiration date: " + license.ExpirationDate.ToString() + "\r\n";
                                 result += "Fully evaluated: " + license.FullyEvaluated.ToString() + "\r\n";
                                 result += "Usable for play: " + license.UsableForPlay.ToString() + "\r\n";
            
                             }
                             else
                             {
                                 result += "Empty license object\r\n";
                             }
            
                             result += "--------------------------------\r\n";
                         }
                     }
            
                     return result;
                 }
        
    
     Faulting application name: myapp.exe, version: 1.0.0.0, time stamp: 0x605ce24a
     Faulting module name: SharedLibrary.dll, version: 2.2.29512.0, time stamp: 0x5fad1b28
     Exception code: 0x80004005
     Fault offset: 0x0064da0e
     Faulting process id: 0x3ba4
     Faulting application start time: 0x01d721ae252b42ad
     Faulting application path: C:\Program Files\WindowsApps\Mypackage.myapp_1.0.479.0_x86__3p48kjqbq46a6\myapp.exe
     Faulting module path: C:\Program Files\WindowsApps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x86__8wekyb3d8bbwe\SharedLibrary.dll
     Report Id: 714afbbb-2c55-4d01-a8b4-0cd9b2e1aab2
     Faulting package full name: Mypackage.myapp_1.0.479.0_x86__3p48kjqbq46a6
     Faulting package-relative application ID: App
    



Any help is greatly appreciated.

Edit:

I have decided to verify claim about the "coding issue" on our side. I've taken MS PlayReady sample from here: https://docs.microsoft.com/en-us/samples/microsoft/windows-universal-samples/playready/

and compiled it in RELEASE configuration. The issue happens even in this sample. My whole project including binaries to reproduce this issue: https://jandrozd.eu/playready/PlayReady_sample.zip

Steps to reproduce the issue:

  1. Install app from install folder

  2. Open it and go to second tab "Proactive license request"

  3. Click "Get license"

  4. App will crash

This happens, again, on line

     var licenses = new PlayReadyLicenseIterable(contentHeader, false);



If you compile (or publish) the app in Debug configuration, issue won't happen.


dotnet-csharpwindows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered JanDrozd-9035 commented

Hello, Welcome to Micorosoft Q&A,


During testing above code, unfortunately, we can't reproduce your problem,
For your scenario, the better way is ask store team check that, I'd suggest you open a free support ticket here: Contact Us. Choose to Contact us, select Dashboard for Topic, and select App submissions and management for issue type.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

To reproduce the issue, the app must be published in Release configuration into appx package. Only in such case I'm able to reproduce it. I have already submitted the ticket as you recommended.

1 Vote 1 ·

Good job, please wait for the submission response, And if you have any other problem, please feel free post new thread in Microsoft Q&A.

0 Votes 0 ·

I got response, however, I'm little bit disappointed (but no hate at all).

Reviewing your information, since the issues is related to the coding of your app, it goes beyond our scope of support. The best course of action, we kindly ask you to refer to our developer forums, or if you need more personalized assistance please feel free to reach our technical support.


However, the code works well. When we are in debug configuration. Only when app gets published, it crashes. How can this be issue of coding in such case?

0 Votes 0 ·
Show more comments

I have decided to verify claim about the "coding issue" on our side. I've taken MS PlayReady sample from here: https://docs.microsoft.com/en-us/samples/microsoft/windows-universal-samples/playready/

and compiled it in RELEASE configuration. The issue happens even in this sample. My whole project including binaries to reproduce this issue: https://jandrozd.eu/playready/PlayReady_sample.zip

Steps to reproduce the issue:

  1. Install app from install folder

  2. Open it and go to second tab "Proactive license request"

  3. Click "Get license"

  4. App will crash

This happens, again, on line

     var licenses = new PlayReadyLicenseIterable(contentHeader, false);



If you compile (or publish) the app in Debug configuration, issue won't happen.

0 Votes 0 ·