Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

785
Views
The requested resource is in use. (Exception from HRESULT: 0x800700AA) - Microsoft WebView

I have following code to launch webview

var env = await Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(userDataFolder: Path.Combine(Path.GetTempPath(), $"{Environment.UserName}_Browser"));
await webView21.EnsureCoreWebView2Async(env);
           
 var url = $"Field1=A2&TypeId=1&ItemId=1234";

 var postData = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(url));
 var request = webView21.CoreWebView2.Environment.CreateWebResourceRequest("https://xxxx/xxxx", "POST", postData, "Content-Type: application/x-www-form-urlencoded");
 webView21.CoreWebView2.NavigateWithWebResourceRequest(request);       

As for my understanding, providing unique userDataFolder should not create problem when multiple users using the application on a same server. It works for some but for some users throws the exception. Is there anything Im missing?

Using Microsoft.Web.WebView2 -Version 1.0.1108.44

Exception

System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use. (Exception from HRESULT: 0x800700AA)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.Web.WebView2.Core.CoreWebView2Environment.<CreateCoreWebView2ControllerAsync>d__54.MoveNext()
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

By looking at the exception, you included, it indicates that the same userdatafolder is used by more than one WebView2 instance. To get around that problem, I suggest you create a new folder for each instance of WebView2 you run.

To do that you can simply create a random name for the folder instead of using one per user. Something like this:

Random rnd = new Random();
string subFolder = rnd.Next().toString();
var env = await Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(userDataFolder: Path.Combine(Path.GetTempPath(), $"{Environment.UserName}", subFolder));

However, you should consider deleting that folder again, when the program shuts down (or you will get a lot of temp folders).

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!