Windows 8 Windows 8互动程序不更新

Windows 8 Windows 8互动程序不更新,windows-8,microsoft-metro,windows-store-apps,Windows 8,Microsoft Metro,Windows Store Apps,以下代码在我使用新项目遵循教程时起作用: 但是,当我将相同的代码插入到实际项目中时,我无法更新应用程序的磁贴 我已经重建了这个包 我已卸载并重新部署该应用程序 我已经更新了宽徽标图像文件 我已经验证了在创建新项目时,相同的代码可以工作 我已经按照链接教程的建议验证了应用程序清单 这在一种解决方案中如何工作良好,而在另一种解决方案中却不行 public MainPage() { this.InitializeComponent(); Clear

以下代码在我使用新项目遵循教程时起作用:

但是,当我将相同的代码插入到实际项目中时,我无法更新应用程序的磁贴

  • 我已经重建了这个包
  • 我已卸载并重新部署该应用程序
  • 我已经更新了宽徽标图像文件
  • 我已经验证了在创建新项目时,相同的代码可以工作
  • 我已经按照链接教程的建议验证了应用程序清单
  • 这在一种解决方案中如何工作良好,而在另一种解决方案中却不行

        public MainPage()
        {
            this.InitializeComponent();
    
    
            ClearTileNotification();
            SendTileTextNotification("Why isn't this working!");
        }
    
        void ClearTileNotification()
        {
            // the same TileUpdateManager can be used to clear the tile since 
            // tile notifications are being sent to the application's default tile
            TileUpdateManager.CreateTileUpdaterForApplication().Clear();
        }
    
        void SendTileTextNotification(string text)
        {
            // Get a filled in version of the template by using getTemplateContent
            var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText03);
    
            // You will need to look at the template documentation to know how many text fields a particular template has       
    
            // get the text attributes for this template and fill them in
            var tileAttributes = tileXml.GetElementsByTagName("text");
            tileAttributes[0].AppendChild(tileXml.CreateTextNode(text));
    
            // create the notification from the XML
            var tileNotification = new TileNotification(tileXml);
    
            // send the notification to the app's default tile
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
        }
    

    您是否尝试过将调用放到页面构造函数以外的其他位置?比如在OnNavigatedTo或OnLoaded事件中。请粘贴生成的XML(在.Update()调用之前中断),并在此处查看XML和c/p。2.注销、登录,并确保代码不会在模拟器内运行。我发现模拟器在显示实时互动程序时完全中断-当我处理实时事件时,我必须经常注销/登录才能看到它工作。