概要
xamlから別プロセスでブラウザを立ち上げ、HTTPSがでの接続が求められるサイトを表示します。
ブラウザへのサイト表示自体は成功するのですが、アプリではエラーになってしまいます。
Application_DispatcherUnhandledExceptionで補足されるこの例外は握りつぶしてしまってよいものでしょうか?回避する方法はありますか?
詳細
- hoge.xaml
C#
1<TextBlock TextAlignment="Center" Margin="0,20" FontSize="16"> 2 <Hyperlink NavigateUri="https://hoge.com" RequestNavigate="Hyperlink_RequestNavigate">こちら</Hyperlink>のページで確認してください。 3</TextBlock>
- hoge.xaml.cs
C#
1private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) 2{ 3 System.Diagnostics.Process.Start("IExplore.exe", "https://hoge.com"); 4}
WPFアプリでハンドルされていない例外を捕捉する領域(App.xaml.csのprivate void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
)で捕捉されます。
そこで例外の内容を見ると下記のようになっています。
- message
要求は中止されました: SSL/TLS のセキュリティで保護されているチャネルを作成できませんでした
- stacktrace
場所 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 場所 MS.Internal.WpfWebRequestHelper.EndGetResponse(WebRequest request, IAsyncResult ar) 場所 System.Windows.Navigation.NavigationService.HandleWebResponse(IAsyncResult ar) 場所 System.Windows.Navigation.NavigationService.<>c__DisplayClass106_0.<HandleWebResponseOnRightDispatcher>b__0(Object unused) 場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 場所 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
ブラウザで操作も続行できるのでこのエラーは無視してよさそうとは思うものの、どう扱うのがよいでしょうか?
動作環境
・.NET Frame Work 4.5
・Visual Studio2015 pro
・Windows10
よろしくお願いします。
__
1
あなたの回答
tips
プレビュー