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.

狀況

當您有一個專案時明確地為目標的.NET Framework 4.6.2 或,會關閉AppContext參數Switch.System.IO.UseLegacyPathHandling, Path.GetDirectoryName()和Path.GetPathRoot()時,擲回例外狀況不正確的路徑傳遞 (例如 http://) 的 URI。

原因

之所以發生這個問題,是因為這些兩個 Api,通常容忍 URI 語法不正確地加入之相同正確性檢查的冒號用於路徑 Api 的其餘部分。

解決方案

若要解決這個問題,請移除 URI 前置詞之前您呼叫這些 Api。或者,您也可以設定AppContext參數Switch.System.IO.UseLegacyPathHandling=true。

.NET Framework 小組正著手提供修正程式,針對這個問題在未來產品的版本。

如需詳細資訊,請參閱.NET Framework 4.6.2 已知問題

更多的資訊

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

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!

×