狀況

當您使用XMLSerializer來序列化System.Security.Authentication.SslProtocols型別值時,您會遇到 「 System.InvalidOperationException 」 錯誤。

原因

發生這個問題在.NET Framework 4.6.2 預覽中,加入一些成員 (SSL2,SSL3) ObsoleteAttribute的System.Security.Authentication.SslProtocols 列舉。因為XMLSerializer不支援ObsoleteAttribute,就會擲回和InvalidOperationException的錯誤。

解決方案

將移除System.Security.Authentication.SslProtocols的ObsoleteAttribute ,4.6.2 的.NET Framework 的未來版本中修正問題。如需有關 Microsoft.NET Framework 4.6.2 預覽的詳細資訊,請參閱.NET Framework 4.6.2 預覽已知問題

更多的資訊

如需詳細資訊,請參閱在.NET Framework 4.6.2 中的應用程式相容性。

需要更多協助嗎?

想要其他選項嗎?

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