C# System.Runtime.InteropServices.COMException:未注册类

C# System.Runtime.InteropServices.COMException:未注册类,c#,.net,uwp,windows-store,C#,.net,Uwp,Windows Store,我将应用程序添加到Windows应用商店。当我下载并运行应用程序时,一切正常,但当一些人下载并运行应用程序时,所以抛出异常 Třída nenízaregistrována==未注册的班级 代码如下: try { StoreContext storeContext = Windows.Services.Store.StoreContext.GetDefault(); string[] productKinds = {"Durable", "Consumable", "U

我将应用程序添加到Windows应用商店。当我下载并运行应用程序时,一切正常,但当一些人下载并运行应用程序时,所以抛出异常

Třída nenízaregistrována==未注册的班级

代码如下:

 try
 {

    StoreContext storeContext = Windows.Services.Store.StoreContext.GetDefault();
    string[] productKinds =  {"Durable", "Consumable", "UnmanagedConsumable" };
    List<String> filterList = new List<string>(productKinds);
    queryResult = await storeContext.GetAssociatedStoreProductsAsync(filterList);
  }
  catch (Exception ex)
  {
        MessageDialog(ex, "UpdateDatabaze");
   }
试试看
{
StoreContext StoreContext=Windows.Services.Store.StoreContext.GetDefault();
字符串[]productKinds={“持久”、“可消耗”、“非托管可消耗”};
列表过滤器列表=新列表(产品种类);
queryResult=await storeContext.GetAssociatedStoreProductsAsync(过滤器列表);
}
捕获(例外情况除外)
{
MessageDialog(例如,“UpdateDatabaze”);
}

任何知道我如何解决此异常的人?

我正在使用支持StoreContext类的目标版本Windows Annivery(构建版本14393)对应用程序进行编程。当用户下载应用程序时,他们的Windows不是周年纪念版,而是只有版本为10586或最低版本的Windows 10,然后抛出异常,该异常在“问题”部分中描述。

哪个应用程序?我可以下载测试吗?你能在你这方面重复这个问题吗?您知道哪个代码行引发此异常吗?发生这种异常的人的环境是什么?能帮你吗?谢谢,但我解决了这个问题。我写了几分钟的解决方案。其实很简单:)