This project has moved and is read-only. For the latest updates, please go here.

"Performance Counter is not a custom counter" error in BizTalk sample

Topics: Developer Forum, User Forum
Mar 26, 2009 at 5:52 PM
Hi

I tried to set up the provided BizTalk example, but I ran into an error while running the orchestration. I simply compiled the solution after pointing the QuickCounters.net.dll to the one in the download package. Did I miss anything?

Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'BizTalkWithQuickCounters.QuickCounterDemo(a86cc5b0-ac89-6634-48ab-251aa695397a)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 5cfcc5e9-c7e1-4217-bbef-85bead71cdf9
Shape name: Init QuickCounters
ShapeId: b6979972-e924-4159-86a4-e6a6e1bbb6a5
Exception thrown from: segment 1, progress 6
Inner exception: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
       
Exception type: InvalidOperationException
Source: System
Target Site: Void Initialize()
The following is a stack trace that identifies the location where the exception occured
 
   at System.Diagnostics.PerformanceCounter.Initialize()
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, Boolean readOnly)
   at QuickCounters.RequestType.Initialize()
   at QuickCounters.RequestType..ctor(String componentName, String requestTypeName, Boolean resetCounterValuesOnAppDomainInit)
   at QuickCounters.RequestType.Attach(String componentName, String requestTypeName, String orchestrationId)
   at BizTalkWithQuickCounters.QuickCounterDemo.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)