MicrosoftEdge / MicrosoftEdge/WebView2Feedback
CapturePreviewAsync exception
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
System.InvalidOperationException : 'CoreWebView2 members cannot be accessed after the WebView2 control is disposed
But WebView2 is not disposed
Version
SDK:
Microsoft.Web.WebView2 1.0.1133-prerelease
Microsoft.Web.WebView2.DevToolsProtocolExtension 1.0.824
Framework: WinForms
OS: Win10
Repro Steps
private async void CopieWebBitmap()
{
MemoryStream ms = new MemoryStream();
await webBrowser1.CoreWebView2.CapturePreviewAsync(CoreWebView2CapturePreviewImageFormat.Jpeg, ms);
Global.xbrowserImage = new Bitmap(ms);
ms.Close();
ms.Dispose();
}
private void webBrowser1_CoreWebView2InitializationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs e)
{
CopieWebBitmap();
}
Screenshots
Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CopieWebBitmap method and webBrowser1_CoreWebView2InitializationCompleted callback in the reported WinForms reproduction. Run the example with Microsoft.Web.WebView2 1.0.1133-prerelease and the listed DevToolsProtocolExtension version, then inspect when the WebView2 control is initialized or disposed relative to CapturePreviewAsync. Done means the lifecycle condition is reproduced and documented with a minimal explanation or confirmed product issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100