Questions tagged [system.diagnostics]

System.Diagnostics is a namespace of the .NET framework. It provides classes that allow you to interact with system processes, event logs, and performance counters.

System.Diagnostics is a namespace of the .NET framework. It provides classes that allow you to interact with system processes, event logs, and performance counters.

References

670 questions
2
votes
0 answers

Remove one event from eventlog (or cast EventRecord to EventLogEntry)

My code sifts through events from a remote PC to test whether there are some 6008 (unexpected reboot) events. I'm using code like: EventLog log = new EventLog("System",remoteMachine); EventLogEntryCollection entries = log.Entries; var…
2
votes
1 answer

Filter Debug statements in the Output Window

I'm finding my Output Window's content quite unpleasant to use, as the window is about 90% full of debug lines from IIS Express and from Application Insights. Ideally I would like to filter the Debug sources that write to that window, but maybe I…
2
votes
3 answers

How to Throw FileNotFoundException from Process.Start

I am trying to call Process.Start() on an executable. If the file cannot be found, it should be copied into the required location and then try again. According to the documentation, Process.Start() can throw a FileNotFoundException when The file…
Bassie
  • 9,529
  • 8
  • 68
  • 159
2
votes
2 answers

Process.WorkingSet64 returns max value of 4294967295

I'm trying to monitor the memory of another process with C#. However, the maximum memory value that Process.WorkingSet64 or Process.PrivateMemorySize64 will output is 4294967295. I've also have the same problem with Performance Counters. Here's my…
Chris Weber
  • 5,555
  • 8
  • 44
  • 52
2
votes
2 answers

Running a program with System.Diagnostics.Process.Start causes a MissingMethodException

I'm working on a Compact Framework 2.0 project, and I'm trying to launch a program "B" from within another program "A" using Process.Start. I've done this several times before, but I'm running into some weird issues this time. Program "B" does…
JayPea
  • 9,551
  • 7
  • 44
  • 65
2
votes
1 answer

get localtime of DateTime in System.Diagnostics.Trace

I've defined some listeners in my app.config + adding traceOutputOptions with a DateTime. It's totally fit my needs of no extra package (log4net)/no extra config. But the DateTime in the file are UTC ones which make then often hard to "quick read"…
camous
  • 998
  • 11
  • 27
2
votes
1 answer

C# killing a labview app

I'm having problems killing a labview process. I'm using this code so far: string NombreProceso = "FORD EPB FINAL Laser"; Process[] ps = Process.GetProcessesByName(NombreProceso); if (ps.Count() == 0) { TextBox_Eventos.AppendText("[+] " +…
2
votes
1 answer

Changing the input stream for the command line in C# from "Csvmidi.exe file.text file.midi" to "Csvmidi.exe inputString file.midi"

Using the process class in System.Diagnostics, I have been able to run an executable file in a program, but I want to generate text in my program and pass it to the executable to convert straight to the output file (the .midi) rather than generating…
2
votes
0 answers

Adding WCF Service Trace Logging programmatically

I currently have WCF Tracing set in my app.config like so :
caa
  • 406
  • 1
  • 8
  • 16
2
votes
2 answers

restart via code on windows 10 uwp

We've created a Windows 10 application that runs on tablets in Windows 10 kiosk mode. It works just fine, however, the wifi connection gets lost sometimes since the locations are very remote. We tried fixing the issue from the networking side, but…
2
votes
0 answers

VS2015: TraceSource Output in Test Explorer?

I've got a library that I'm trying to unit test. I use TraceSource to write out warning details, and as I have the unit tests set to run as part of the build, I'd like them to show up when the tests are run - particularly on failure. I've tried the…
2
votes
1 answer

System.Diagnostics.Process(); StartInfo.Arguments use Environment Variables as argument

How is it possible to pass environment variables as arguments to a System.Diagnostics.Process()? Using a variable path fails for some reason. For instance, I'm trying to open explorer at the path %windir%, this fails: program: explorer.exe args: /n,…
user937036
  • 341
  • 1
  • 3
  • 15
2
votes
1 answer

why can't i find process class in my System.Diagnostics silverlight project VS 2010

i wanna use process.getprocesses() but it doesn't seem to be in my diagnostics class, why?!!!
Miroo
  • 795
  • 3
  • 13
  • 35
2
votes
2 answers

Problems With Spaces In Path In System.Diagnostics.Process parameters

First let me say that this question is not a duplicate of Use Process.Start with parameters AND spaces in path. I am using the System.Diagnostics.Process to start a cmd.exe window and then running java in that window. Except I want the java…
Taien
  • 23
  • 6
2
votes
1 answer

How to create an EventBookmark when querying the event log

I have an EventLogReader object, and a query in the event log that looks like this: string query = "*[System[(Level=2) and TimeCreated[@SystemTime>='%LastRun%']]]") The code basically uses the reader to query for all the events that match the…
dylanT
  • 1,080
  • 1
  • 13
  • 26