19

I have a web application that throws the following error when running in IE:

Illegal operation attempted on a registry key that has been marked for deletion

It works fine in Chrome. Unfortunately this is a production deployment and I do not have access to see any more detailed information on the error.

I have read some information related to this error message here

http://social.msdn.microsoft.com/Forums/en-US/90e22b43-e24f-44be-9345-ecbade0b32c9/urgent-comexception-illegal-operation-attempted-on-a-registry-key-that-has-been-marked-for?forum=commserver2007

and here

http://blogs.msdn.com/b/distributedservices/archive/2009/11/06/a-com-server-application-may-stop-working-on-windows-server-2008.aspx

Here is the Windows Event log which is consistent with what is described in those 2 links:

enter image description here

But it boggles me as to why this would only be occurring when using IE. Any ideas?

HerbalMart
  • 1,669
  • 3
  • 27
  • 50
mclaassen
  • 5,018
  • 4
  • 30
  • 52

4 Answers4

18

The error seems to be caused by either a bug or memory leak related to COM+. Restarting the Application Pool or restarting IIS should fix the issue. Be warned that it might crop up again out of the blue, so consider restarting your app pool on a scheduled basis.

It is unlikely that the error is browser related. It is possible the app was working in Chrome due to caching. Or perhaps production has multiple servers, and Chrome was hitting a good server, and IE was hitting the bad sever.

James Lawruk
  • 30,112
  • 19
  • 130
  • 137
16

FROM MSDN

https://blogs.msdn.microsoft.com/dsnotes/2016/03/01/com-intermittent-error-800703fa-illegal-operation-attempted-on-a-registry-key/

Cause:

The event warning explains that when the profile was being unloaded, the w3wp.exe process had a registry key handle to the profile hive for the user.

As per the kb947238 article, event 1530 occurs because Windows automatically closes any registry handle to a user profile that is left open by an application. This causes the error 800703fa.

Resolution:

Go to IIS Manager, select the Application Pool for your web application and click Advanced settings, change the value for "ProcessModel" > "Load User Profile" to "true"

screenshot of IIS settings, Application Pool, Advanced Settings, Process Model heading, Load User Profile setting, value is False, value should be True

Setting this values makes the IIS loads the user profile for the application pool identity.

WORKAROUND (NOT FROM MSDN) Either recycle the application pool or do an iisreset.

Nate Anderson
  • 18,334
  • 18
  • 100
  • 135
HerbalMart
  • 1,669
  • 3
  • 27
  • 50
1

Had the same error come up from my own javascript in IE and it was on a line where I called

window.localStorage

The machine that triggerred this had McAfee installed but I'm not sure if it was active or not.

MacD
  • 426
  • 3
  • 13
  • I don't think it's related to IE, or any browser for that matter as it's an IIS error rather than a browser error. In my instance, once it starts happening, it's happening when we receive a Signal-R message back to the browser and the only way we've manage to fix it is by restarting IIS which is not a solution tbh but hopefully a temporary work-around. I will try one of them mentioned above and hope this will work without having to restart IIS. – Thierry Dec 20 '22 at 16:25
0

I got this error working with Microsoft.Web.Administration.ServerManager. It turned out to be because I was calling appPool.Start() after calling serverManager.CommitChanges()

kevinpo
  • 1,853
  • 19
  • 20