Cannot continue the current operation, the performance counters memory mapping has been corrupted.

Sep 16, 2008 at 2:02 AM
Firstly I have purchased your book and it's amazing. I'm having a problem when i deploy this on a server. Running locally everything is fine i have configured my connection string so that the application is pulling the information for my SQL 2005 database. But when i publish the project to my server i get the following error

<title>Cannot continue the current operation, the performance counters memory mapping has been corrupted.</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>

Server Error in '/' Application.

Cannot continue the current operation, the performance counters memory mapping has been corrupted.

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: Cannot continue the current operation, the performance counters memory mapping has been corrupted.

Source Error:

Line 104:                Profile.Save();
Line 105:                
Line 106:              _Setup = new DashboardFacade(Profile.UserName).NewUserVisit();
Line 107:            }
Line 108:            else

Source File: e:\web\babygarages\htdocs\Default.aspx.cs    Line: 106

Stack Trace:

[InvalidOperationException: Cannot continue the current operation, the performance counters memory mapping has been corrupted.]
   System.Diagnostics.SharedPerformanceCounter.ResolveOffset(Int32 offset, Int32 sizeToRead) +701950
   System.Diagnostics.SharedPerformanceCounter.CalculateAndAllocateMemory(Int32 totalSize, Int32& alignmentAdjustment) +31
   System.Diagnostics.SharedPerformanceCounter.CreateCategory(CategoryEntry* lastCategoryPointer, Int32 instanceNameHashCode, String instanceName, PerformanceCounterInstanceLifetime lifetime) +288
   System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName, String instanceName, Boolean enableReuse, PerformanceCounterInstanceLifetime lifetime) +223
   System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime) +142
   System.Diagnostics.PerformanceCounter.Initialize() +458
   System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly) +110
   System.Workflow.Runtime.PerformanceCounterManager.CreateCounters(String name) +76
   System.Workflow.Runtime.PerformanceCounterManager.SetInstanceName(String instanceName) +398
   System.Workflow.Runtime.WorkflowRuntime.StartRuntime() +628
   DashboardBusiness.WorkflowHelper.Init() in C:\dropthings-16855\trunk\DashboardBusiness\Workflows\WorkflowHelper.cs:97
   DashboardBusiness.WorkflowHelper.ExecuteWorkflow(Type workflowType, Dictionary`2 properties) in C:\p\dropthings-16855\trunk\DashboardBusiness\Workflows\WorkflowHelper.cs:25
   DashboardBusiness.DashboardFacade.NewUserVisit() in C:\dropthings-16855\trunk\DashboardBusiness\DashboardFacade.cs:34
   _Default.LoadUserPageSetup(Boolean noCache) in e:\web\babygarages\htdocs\Default.aspx.cs:106
   _Default.CreateChildControls() in e:\web\babygarages\htdocs\Default.aspx.cs:81
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
Now i have notice that the application is looking at my deployment machine and i'm thinking that this might be were my problem is any help would be greatly appreciated.

Cheers
Sep 17, 2008 at 3:44 PM
I have seemed to fix my own problem. After doing a bit of research, make sure that when you deploy to your production server turn debug of to false. It's seems that the overhead of using debug on a production server causes this issue
Sep 18, 2008 at 10:08 AM
Thanks, i was facing same problem and your post solved it.$0$0$0$0On debug=true$0$0http://weblogs.asp.net/scottgu/archive/2006/04/11/442448.aspx$0$0$0$0$0$0$0$0
Nov 7, 2008 at 9:08 AM
The problem was permanently sovled by our hosting company, they resolved it by rebuilding the performance counters

http://support.uptimesoftware.com/article.php?id=162