I want to create a situation where .Net throws this exception:
InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
For example, in this question Cannot load Counter Name data because an invalid index -Exception
The reason I want to do this is because a small but significant percentage of the users of my application encounter this and I want to detect that situation and show a dialog that can help users fix it by running lodctr. (Unfortunately, simply fixing the calling code isn't an option as the exception is thrown in a third party library) To validate this process, I will need to be able to encounter the problem.
It should go without saying, but I would like to corrupt the performance counter registry in a way that my computer remains usable and is easily recoverable by using lodctr. I don't want to brick my machine.