-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Problem/Bug]: Microsoft.Web.WebView2 throws an System.Runtime.InteropServices.COMException (0x8007139F) randomly #4218
Comments
I get this error also. For me it worked yesterday. The only option for Microsoft Edge WebView2 Runtime (in Control Panel appwiz.cpl) is "Repair". I would love some additional suggestions! |
I should note that this error may go away for me. Reboot number 4 coming up. I will update here if the error gets resolved by an update. |
Here is another thread about |
Thank you for the suggestion! 🙂 I ran into that situation earlier in development (already another browser process running in the same user data folder) For good measure, I closed all instances of (any) browsers and most apps, just in case. |
@vbryh-msft, I tried two of the samples you recommended in the other thread, with the same results. Lunch is over, I'll check back in tonight and try some more.. |
@kodybrown from your traces the webview2 runtime can not be started because of incompatible DPI awareness. The expectation in traces is that it should be |
Is there a solution? I am having the same error with the sample apps. System.Runtime.InteropServices.COMException: 'The group or resource is not in the state required to perform the requested operation. (0x8007139F)' |
Hi @carrie-battaglia - you would need to understand why it happens in order to fix it. Have you read the threads how to troubleshoot? |
@carrie-battaglia - can you collect traces when you repro it? |
I have seen this error; as I found that a second attempt to create the environment after closing my application always worked; I implemented a try catch with a 5 second delay and then retried to create the environment. The retry has worked... |
I followed the directions for the trace and found that I have Microsoft Teams running in the background (which has multiple msedgewebview2.exe's in task manager). I don't use that app - maybe it started from some update. Once I quit that app, the sample ran without the exception. So the issue now is, how will my webview2 component work if a user has anything else running that uses webview2? I'm assuming this might have to do with setting a unique environment but I have not gotten that to work correctly. I submitted this issue a few months ago: #4163 but have not gotten any feedback (during a build, my VS project launches msedgewebview2.exe and does not clean them up. When I run the project, I get the exception 'The group or resource is not in the state required to perform the requested operation. (0x8007139F)'). |
@carrie-battaglia sounds like you have user data folder override somewhere in you system (WEBVIEW2_USER_DATA_FOLDER env var or reg key) and each app tries to attach to browser started from that UDF. UDF overrides are intended to be used for debugging purpose only. Here is some reading about process model. Hope it helps. |
I had the same problem however the Exception did not have the code 0x8007139F after it (maybe due to localization in VS2022 but the message was the same) and the exception was thrown every time I attempted to call WebView.EnsureCoreWebView2Async() breaking an important feature in my app. It was suggested to me to delete the bin and obj folders in the project and build the solution again. For me it was MySolution/MyApp.Desktop/bin and MySolution/MyApp.Desktop/obj. |
What happened?
This is crazy! I got a System.Runtime.InteropServices.COMException: 'The group or resource is not in the state required to perform the requested operation. (0x8007139F)' at very simple sample Application. I simplify made basic Microsoft Visual Studio 2022 Windows c# Forms Application and add latest stable version of that Microsoft.Web.WebView2 nuget package, some Designer changes and that code below:
Everything, other code and settings etc. are exactly at default values.
And one very strange thing is that at first this code worked perfectly fine, but then once I ran again my project I got this error.
I tred to found something from the internet, but everything info about these I found not worked for me or was too hard to understand... :(
Can someone please help me!
Things I have tried:
Changing the code
Reinstalling the nuget package
Using different (older) versions of the nuget package
Creating new clear project
Disabling firewall
Fixing Microsoft Edge WebView2 Runtime from Control Panel
Changing network
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
1.0.2151.40
SDK Version
1.0.2151.40
Framework
Winforms
Operating System
Windows 10
OS Version
19045.3693
Repro steps
It seems that if I change the solution this error appears and this might be some kind of cache error. So if I took Microosft's Webview2 Sample Repo, it worked for a while, but when I removed one other project from this solution, it also stops working.
Repros in Edge Browser
Not Applicable
Regression
Don't know
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: