How to properly clear the cache on Awesomium.NET WPF 1.7.1 while running

3.8k Views Asked by At

My WebControl is defined in XAML like so

<aw:WebControl Source="http://google.com" Name="wpfWebControl"/>

I found this, and attempted to follow it's instructions by disposing the WebSession and views, like this

        var webSession = this.wpfWebControl.WebSession;
        this.wpfWebControl.Dispose();
        webSession.Dispose();
        WebCore.Update();

then tried to delete the directory where the cache was stored with a simple

Directory.Delete(WEBSESSION_CACHE_PATH), true);

where WEBSESSION_CACHE_PATH is the directory where the cache files are stored.

I encounter an UnauthorizedAccessException, therefore the files are still in use. Not only that, if I dispose my WebControl, the screen goes blank, and restoring it with

this.wpfWebControl = new WebControl() won't work either.

How am I supposed to do this?

1

There are 1 best solutions below

0
On

A WebSession.ClearCache has been added in v1.7.2.