Replies: 4 comments
-
Beta Was this translation helpful? Give feedback.
-
Thanks, @sln162, I'm aware of #202 and checked everything there. Could you clarify what you imply that I did wrong? |
Beta Was this translation helpful? Give feedback.
-
#3130 (comment) |
Beta Was this translation helpful? Give feedback.
-
Hi @UweKeim, @sln162‘s right. Do you want to run WebView2 in a console application? If it does, you can follow #202. Hope to solve your problem. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is my whole program for a .NET 7 Console application running as 64-bit on Windows 11:
When starting it, the call to
CoreWebView2Environment.CreateAsync
throws an error:The call stack is:
I've tried to remove the
[STAThread]
attribute and also tried to change it to[MTAThread]
but this did not change the error message.My CSPROJ file looks like this:
When running the same code inside a WinForms .NET 7 application, the code runs successfully.
My question
How should I change my code in order to successfully use WebView2 inside a console application?
Beta Was this translation helpful? Give feedback.
All reactions