Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

狀況

假設您有 Microsoft.NET Framework 4.7 安裝在電腦上。當您嘗試插入快取物件中的項目,使用Cache.Insert (字串、 物件 CacheDependency、 日期時間、 TimeSpan)插入的多載方法,您可能會發現插入快取項目過期更早的或晚於指定日期時間(到期時間)。

原因

System.Web.Caching.Cache的內部實作使用絕對期限的國際標準時間 (UTC) 時間戳記。但此特定Cache.Insert (字串、 物件 CacheDependecy、 日期時間、 TimeSpan) 插入的多載方法不確知是否將到期時間轉換為 UTC。因此,早於或晚超過預期,視電腦的時區差異從格林威治標準時間 (GMT) 而定,將會發生插入至快取物件藉由使用這個多載的項目到期日。

因應措施

這個問題的暫時解決方法是使用Cache.Add方法或不同的Cache.Insert多載方法。

解決方案

這個問題將在下一個版本的.NET Framework 中,修正,並將也會在下一步的.NET Framework 的 4.7 hotfix 中。

狀態

Microsoft 已確認這是<套用>一節所列出的 Microsoft 產品的問題。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×