Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

786
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda