We've seen a few of these issues come through lately andwanted to get something posted so people can find it.
If you created a custom account to run the process that ASP.NET is running in, you may encounter the following exception:
System.InvalidOperationException: Mutex could not be created.Stack Trace: [InvalidOperationException: Mutex could not be created.] System.Web.Compilation.CompilationMutex..ctor(String name, String comment) +3464689 System.Web.Compilation.CompilationLock..cctor() +158
[TypeInitializationException: The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.] System.Web.Compilation.CompilationLock.GetLock(Boolean& gotLock) +32 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +114
[HttpException (0x80004005): The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3426871 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +149--------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Note: The error will appear to be random, but once it appears, will remain until a reboot or until the handles to the mutex are closed.
Cause:======This occurs because the permissions on the following registry key no longer have your custom account:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0\CompilationMutexName
The compilation mutex gets it's permissions from this registry key and with your custom account missing, the process running ASP.NET cannot get a handle to the mutex and fails during compilation.
Resolution:=========
To close the handles to the Mutex:
Additional Info:============The error may occur anytime you run ASP.NET as a custom account and the above mentioned registry key does not have the account listed in the permissions.
If you receive the error and you are running with a custom account on IIS 6 in worker process mode (code running in w3wp.exe), you can add your custom account to the IIS_WPG group on the server. The IIS_WPG group is granted access to the registry key by default.
Today I was stuck for the first time with this: System.InvalidOperationException: Mutex could not be
Mutex could not be created 的异常错误解决办法
Hi Jerry
it work works great for me.. although when i restart my workstation the saaaame problem hapnd, i fixed it doing the same steps you published
my question is... is this going to hapn everytime i reset my pc? isnt there a way to keep it permanent or is there something im just doing wrong or something to check maybe??
many thanks in advanced bro
Hi Jerry,
I receive the same exception using .NET 1.1
Is the the resolving solution be the same as for .NET 2.0?
1、 当前标识(NT AUTHORITY\NETWORK SERVICE)没有对“C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
正解: http://blogs.msdn.com/jorman/archive/2006/07/24/system-invalidoperationexception-mutex-could-not-be-created.aspx 1) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASPNET_regiis -ga yourdomain\youraccount 2) iisreset
On the recommendation of a trusted co-worker who shall remain unnamed, I had installed the March CTP
To clean up an old farm from some setup errors, I recently rebuilt the farm from bare metal, re-attaching