Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer (MCSD) Certification Exam. Practice with flashcards and multiple choice questions. Master each topic with hints and insights. Achieve your certification goals!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which method is used to create a custom Performance Counter?

  1. PerformanceCounter.Create

  2. PerformanceCounterCategory.Exists

  3. PerformanceCounterCategory.Create

  4. CounterCreationData.Create

The correct answer is: PerformanceCounterCategory.Exists

The correct method used to create a custom Performance Counter is found within the PerformanceCounterCategory class. Specifically, the PerformanceCounterCategory.Create method is utilized to create a new performance counter category or to add counters to an existing category. This method allows developers to define the name, type, and data type of the performance counters as well as other settings, making it central to the creation of custom performance counters. The other options reflect methods that either do not exist or do not achieve counter creation. For instance, PerformanceCounter.Create is not a defined method; instead, the PerformanceCounter class is typically used to read and write values to counters that have already been created. PerformanceCounterCategory.Exists checks for the existence of a performance counter category without creating one, and CounterCreationData is a data structure used to define the properties of individual counters but does not create them itself—it requires the PerformanceCounterCategory.Create method for actual creation. Understanding these distinctions highlights why PerformanceCounterCategory.Create is the appropriate choice for creating custom performance counters.