我有一个带有自定义表单身份验证的 Silverlight 应用程序。关闭浏览器窗口时如何注销应用程序?
我试过这样的事情:
 public App()
    {
        Startup += ApplicationStartup;
        Exit += Application_Exit;
        UnhandledException += ApplicationUnhandledException;
        var webContext = new WebContext {Authentication = new FormsAuthentication()};
        ApplicationLifetimeObjects.Add(webContext);
        InitializeComponent();
    }
    private void ApplicationStartup(object sender, StartupEventArgs e)
    {
        Resources.Add("WebContext", WebContext.Current);
        RootVisual = new MainPage();
    }
    private void Application_Exit(object sender, EventArgs e)
    {
        WebContext.Current.Authentication.Logout(false);
    }
但这没有用。每次关闭浏览器时,我都会收到异常An AsyncCallback 抛出异常而没有任何详细信息。
我该如何处理这个问题?