Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

792
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda