Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid window handle. (Exception from HRESULT: 0x80070578) #3

Closed
lucaswhob opened this issue Apr 16, 2024 · 1 comment
Closed

Invalid window handle. (Exception from HRESULT: 0x80070578) #3

lucaswhob opened this issue Apr 16, 2024 · 1 comment

Comments

@lucaswhob
Copy link

Hello My Friend I Use Your Guide To Use Headless WebView2
I Use This Code :
private IntPtr HWND_MESSAGE = new IntPtr(-3); CoreWebView2Environment webView2Environment = CoreWebView2Environment.CreateAsync(null, AppContext.BaseDirectory + "\\whatsappdata\\" + workingdirectory).GetAwaiter().GetResult(); maincontroller = await webView2Environment.CreateCoreWebView2ControllerAsync(HWND_MESSAGE);
But Error Run WebView2 From IIs
This Simple WinForm Application
Locally Run Good But Run From IIs Exception Throw

@RickStrahl
Copy link
Owner

RickStrahl commented Apr 21, 2024

You need to make sure you use a Windows account. I believe it won't work with IIS_APPLICATIONPOOLIDENTITY as there are permissions issues. It works for me with NETWORK SERVICE/SYSTEM or actual user account assuming you have permissions to write out the environment folder (you can specify a location).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants