UWP 記一次WTS 和 UCT翻車經歷
阿新 • • 發佈:2018-03-18
ont too templates input 修改 gpo cnblogs pup dial 原文:UWP 記一次WTS 和 UCT翻車經歷
這次翻車,真的,在網上絕對找不到回答的。
只有在WTS的Issues討論中才找到,哈哈
不過這個應該比較少遇到吧,據我所知,提出Issue那個大胸弟和我都遇到了。。。
翻車具備的條件如下:
1. 使用了WTS(Windows Template Studio)的What‘s New Prompt,版本是1.7之前的。我的項目是2017年9月份創建的,版本應該是的。好像1.6當時
2. 添加了UWP Community Toolkit 的 SystemInformation
類, 我是直接引用了SystemInformationPage。
如果你兩個都碰到了,恭喜!!!
調試的時候,Json反序列化一定異常。
Newtonsoft.Json.JsonReaderException: ‘Input string ‘2018.1.19.0‘ is not a valid number. Path ‘‘, line 1, position 7.‘
這個是版本號,本來是字符串類型,在反序列化的時候,卻把他當成了數字類型。
解決辦法呢,老外也給了,你不嫌麻煩,可以直接去https://github.com/Microsoft/WindowsTemplateStudio/issues/1659查找。
我直接挑明了說。
直接修改WhatsNewDisplayService.cs
public static class WhatsNewDisplayService { internal static async Task ShowIfAppropriateAsync() { if (Microsoft.Toolkit.Uwp.Helpers.SystemInformation.IsAppUpdated) { var dialog = newWhatsNewDialog(); await dialog.ShowAsync(); } } }
UWP 記一次WTS 和 UCT翻車經歷