Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception. System.Exception: PDH_CSTATUS_NO_OBJECT #66

Open
swasheck opened this issue Jan 26, 2022 · 0 comments
Open

Unhandled exception. System.Exception: PDH_CSTATUS_NO_OBJECT #66

swasheck opened this issue Jan 26, 2022 · 0 comments

Comments

@swasheck
Copy link

Getting PDH_CSTATUS_NO_OBJECT error when attempting to parse blg files

Unhandled exception. System.Exception: PDH_CSTATUS_NO_OBJECT
   at Tx.Windows.PdhUtils.CheckStatus(PdhStatus actualStatus, PdhStatus[] expectedStatus)
   at Tx.Windows.PdhUtils.GetCounterAndInstanceList(String logFilename, String machineName, String objectName, List`1& counterList, List`1& instanceList)
   at Tx.Windows.PdhUtils.GetCounterPaths(String dataSource)
   at Tx.Windows.PerfCounterFileReader..ctor(IObserver`1 observer, String file)
   at Tx.Windows.PerfCounterObservable.<>c__DisplayClass0_0.<FromFile>b__0(IObserver`1 o)
   at System.Reactive.AnonymousObservable`1.SubscribeCore(IObserver`1 observer) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\AnonymousObservable.cs:line 37
   at System.Reactive.ObservableBase`1.ScheduledSubscribe(IScheduler _, AutoDetachObserver`1 autoDetachObserver) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\ObservableBase.cs:line 82
--- End of stack trace from previous location ---
   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\ExceptionServicesImpl.cs:line 16
   at System.Reactive.ExceptionHelpers.ThrowIfNotNull(Exception exception) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Internal\ExceptionServices.cs:line 20
   at System.Reactive.Linq.ObservableImpl.GetEnumerator`1.MoveNext() in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\Observable\GetEnumerator.cs:line 70

Code that causes the error:

var rawcounters = PerfCounterObservable.FromFile(filename);
int count = rawcounters.Count().Wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant