You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Rendering in console apps works if I start the console app in the context of the current logged in user.
If i start the console app as child process of a Windows service (no UI available) CreateCoreWebView2ControllerAsync does not return.
internalclassProgram{privatestaticreadonlyIntPtrHWND_MESSAGE=new IntPtr(-3);[STAThread]staticvoidMain(string[]args){
Test();
Application.Run();}staticasyncvoidTest(){
SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext());await Task.Delay(1);// wait for the application loop to startvarbrowserEnv=await CoreWebView2Environment.CreateAsync();varwvController=await browserEnv.CreateCoreWebView2ControllerAsync(HWND_MESSAGE);// not working in a Windows Service Childprocess
wvController.Bounds =new System.Drawing.Rectangle(0,0,100,100);
wvController.CoreWebView2.Navigate("http://localhost/");TaskCompletionSource<bool>tsc=newTaskCompletionSource<bool>();
wvController.CoreWebView2.NavigationCompleted +=(s,e)=>{ tsc.SetResult(true);};await tsc.Task;using(FileStreamstream=new FileStream("D:\\testImg.png", FileMode.Create)){await wvController.CoreWebView2.CapturePreviewAsync(CoreWebView2CapturePreviewImageFormat.Png, stream);}
Application.Exit();}}
Description
Rendering in console apps works if I start the console app in the context of the current logged in user.
If i start the console app as child process of a Windows service (no UI available)
CreateCoreWebView2ControllerAsync
does not return.Version
SDK: 1.0.1518.46
Runtime: Evergreen 109.0.1518.70
OS: Win11 22H2
Framework: .NET 4.8 Console App
The text was updated successfully, but these errors were encountered: