【发布时间】:2017-08-21 22:51:09
【问题描述】:
我有
CurrentAppSimulator.LicenseInformation.ProductLicenses["nonexistentEntry"]
(MSDN)
而且它不会抛出异常。
这是预期的吗?它会一直这样做吗?
【问题讨论】:
-
这不可能是你的全部陈述,它不会通过编译器。
Only assignment, call, increment, decrement, and new object expressions can be used as a statement -
@RufusL 正确。它是
var l = ... ;。我只是展示了可能相关的部分。 -
请发表完整的声明。
-
ProductLicenses 的确切类型是什么
-
LicenseInformation.ProductLicenses 不是字典。它是 IReadOnlyDictionary。而且暗示可能不是字典。
标签: c# .net uwp windows-store-apps win-universal-app