The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.

This is the error I receive when I try to Build my website.

The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.

My website was created using the IIS on localhost option and that is how I open it.

If select View In Browser for any page, I receive the following HTML response:

Server Error in '/websiteX' Application.

Mutex could not be created.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Mutex could not be created.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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

What could be the problem? 

I normally try to do my development work under a non-Administrator account.  Are there some additional permissions that need to be set?

Thanks.

 

0
gsbell
3/7/2006 5:16:17 AM
asp.net.web-dev-2005-express 3977 articles. 0 followers. Follow

1 Replies
860 Views

Similar Articles

[PageSpeed] 9

I had to elevate my developer account to the Administrators group to finally get around this stupid error:

Mutex could not be created.

-or-

The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.

So the big Microsoft question is:

Why can't we develop under a non-Administrator accunt?

And I thought Microsoft was pushing for a more secure work environment.

 

0
gsbell
3/7/2006 9:50:31 PM
Reply:

Similar Artilces:

Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'
I always get the below exception if I make a configuration change to the web.config file then request a page without re-building the project. Exception: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'. Stack Trace: [InvalidCastException]: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Compilation.BuildResultCompiledGlobalAsaxType'.   at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrec...

Help Required
Server Error in '/' Application.--------------------------------------------------------------------------------Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'. [InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultCompiledAssembly' to type 'System.Web.Util.ITypedWebObjectFactory'.] System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +123 System.Web.Compilation.BuildMa...

Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Hello, I get this lovely error whenever I attempt to load an AJAXToolKit ScriptManager. It is the only one I have on the page. If I use the regulare script manager, my extenders don't detect it. I'm placing the ScriptManager just after the <Form> tag. The frustrating part is that it works when I preview it in the browser from my development machine it works, but once I place it the live server, it crashes on me . I've installed all of the .dlls in the proper places. Also, I'm trying to attempt to do this when creating a new site with the AJAX ToolKit enabled templat...

Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.
I have tried to upgrade an existing application from VS2005 to VS2008.  I downloaded the latest AjaxControlToolkit and referenced it in my project.  I'm getting the below error when I try to deploy to our QA servers.  I'm NOT seeing the issue on our local development machines that have VS2008 installed.   Unable to cast object of type 'System.Web.Configuration.ScriptingAuthenticationServiceSection' to type 'System.Web.Configuration.ScriptingAuthenticationServiceSection'.  What piece am I missing in the deployment?  All the w...

Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Hello, I get this lovely error whenever I attempt to load an AJAXToolKit ScriptManager. It is the only one I have on the page. If I use the regulare script manager, my extenders don't detect it. I'm placing the ScriptManager just after the <Form> tag. The frustrating part is that it works when I preview it in the browser from my development machine it works, but once I place it the live server, it crashes on me . I've installed all of the .dlls in the proper places. Also, I'm trying to attempt to do this when creating a new site with the AJAX ToolKit enabled templat...

Mutex could not be created, 'System.Web.Compilation.CompilationLock' threw an exception.
   I have just installed Visual Web Developer 2005 Express Edition, and created a really simple website just to test it out. But I can't debug, I just get the error Mutex could not be created. I followed someones advice on another forum and deleted the temporary files in the .Net Framework 2.0 Temporary folder, and then tried a build and I just get buid error 'System.Web.Compilation.CompilationLock' threw an exception.   What do I need to do to stop this happening? Thanks    After trying loads of different ways around the issue, I seem to have sol...

Error 1 The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\asse
Once I build project. I encounter this error. Does someone experience this error?Error    1    The type 'System.Web.UI.WebControls.LinqDataSource' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.6.0.0__31bf3856ad364e35\System.Web.Extensions.dll'    D:\Source Code\Linq_Lesson5\Default.aspx    1    1    D:\Source Code\Linq_Lesson5\  It appears tha...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'
Hello, Goal: enter a number in two fields HoursPerUnit and PeoplePerUnit and the value for the third field, TotalHoursPerUnit will populate after the the number in the two fields have been caculated.  Using the code below I receive the error message above.  Please tell me what am I doing wrong? Do I need to cast the text as a literal?  Please help? Thank you in advance, <%@ Page Language="VB" MasterPageFile="Default.master" AutoEventWireup="false" CodeFile="frmHR.aspx.vb" Inherits="frmHR"...

Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'.
Hi, any idea why I'm getting the following error?Line 45: protected void CartGrid_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) Line 46: { Line 47: TextBox QuantityTextBox = (TextBox)CartGrid.Rows[e.RowIndex].Cells[2].Controls[0]; Line 48: int Quantity = Convert.ToInt32(QuantityTextBox.Text); Line 49: Are you sure that the control at CartGrid.Rows[e.RowIndex].Cells[2].Controls[0] isn't a LiteralControl?  How are you creating code this in your code?Brent JenkinsASP.NET, C#, Web Developerwww.valewebdesign.co.uk  ...

Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox'
I am attempting to "Update" a field in a Datagrid, but no matter what I do (Using either Label or Text Boxes)  I keep getting the same error: Unable to cast object of type 'System.Web.UI.WebControls.Label' to type 'System.Web.UI.WebControls.TextBox' The Error is highlighted below in the Sub... <==THE FIELD THAT CALLS THE ERROR  Any help would be greatly appreciated !!! Thanks !!   The code is as follows... <table border=0 height=210 bordercolor=olive ><tr valign=top><td> <asp:datagrid id="FacilityDataGrid"...

Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.
Hi,  I have a formview with a dropdownlist created dynamically. i want to determine whether the dropdownlist was clicked. the code is written in the FormView1_DataBound method. I get the following error in the line below that is in italics and underlined: Unable to cast object of type 'System.Web.UI.WebControls.FormView' to type 'System.Web.UI.WebControls.DropDownList'.   Here is my code: ddl_iFullname = New DropDownList ddl_iFullname.ID = "ddl_iFullname" ddl_iFullname.DataSource = ObjectDataSource3 ddl_iFullname.DataTextField = "fullname" ddl_iFullname.DataValueField = "...

Value of type 'System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap'.
 Hello,         I receive this error "System.Web.UI.Control' cannot be converted to 'System.Web.SiteMap" when I try to find the Sitemap control.  ...            <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />            <asp:ListView ID="ListView1" runat="server">            <LayoutTemplate>    ...

Error: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField'
Hello, I am getting the following error during compiliation. Any suggestions to fix it. Thanks. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' protected void gvEvents_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow selectedRow = gvEvents.Rows[index]; string sID; ButtonField btn; if (selectedRow.RowType == DataControlRowType.DataRow) { sID = ((ButtonField)selectedRow.FindControl("ID")).DataTextFi...

Problem with AjaxControl kit error Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364
I'm trying to use the Tabs from the Ajaxcontrol kit.I have installed Ajax WebExtension 1.0 to the server i'm runnig the apps fromI'm sure the version of my Ajaxcontrol kit and the System.Web.Extensions i'm trying to use is 1.0.61025. But it seems the one on 3.5 is also there since the server has been updated to v3.5 .net framework I get this error below:  Compiler Error Message: CS0433: The type 'System.Web.UI.ScriptManager' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll...

Web resources about - The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. - asp.net.web-dev-2005-express

Resources last updated: 1/2/2016 1:16:19 PM