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
4
votes
3 answers

C# System.Diagnostics.Process verb issue

I have a Windows Application written in C# VS 2008. The purpose of this application is to convert any file to PDF files. I have found code that works on converting the files however there is a small issue that I am coming across. First here is the…
mattgcon
  • 4,768
  • 19
  • 69
  • 117
4
votes
1 answer

How to read event logs with folders?

I want to programmatically get the event log that appears in a folder in eventvwr. This one is for Windows 8 Apps: Microsoft-Windows-AppHost/Admin. I'm running as Admin. This is not…
will
  • 3,975
  • 6
  • 33
  • 48
4
votes
1 answer

How do I globally exclude an error for a certain message with the VS2012 code analysis tool?

I'm currently getting the following messages from the VS2012 code analysis tool: CA1709 Identifiers should be cased correctly In member 'Action.ExecuteAction(string, string)', correct the casing of 'ID' in parameter name 'merchantID' by…
Codeman
  • 12,157
  • 10
  • 53
  • 91
4
votes
3 answers

nlog: Using "Trace" output makes Logger.Error() throw an exception - how to fix?

I'm using NLog for our logging. I am trying to set up a way of getting it to output stuff to System.Diagnostics.Trace(), so I set up the NLog.config file as follows:
Matthew Watson
  • 104,400
  • 10
  • 158
  • 276
4
votes
1 answer

Trouble executing large batch file from C#

I'm executing a batch file from my C# application using the System.Diagnostics classes, updating my GUI with the output along the way, but as soon as my batch file is in excess of a certain number of lines, the process just hangs. The exact amount…
Stephan B
  • 837
  • 1
  • 16
  • 41
3
votes
2 answers

TraceSource across threads doesn't work?

I think I've lost my mind guys.. According to MSDN, TraceSource is thread safe. So I have a simple console app. In it, I declare; private static readonly TraceSource ActiveTraceSource = new TraceSource("Test"); In my app.config, I…
XeroxDucati
  • 5,130
  • 2
  • 37
  • 66
3
votes
1 answer

Can ReSharper's test runner be configure not to show Debug.WriteLine() messages?

I want to omit Debug.Write/WriteLine messages from ReSharper's test runner output. Is it doable?
THX-1138
  • 21,316
  • 26
  • 96
  • 160
3
votes
2 answers

Trace.WriteLine not producing any output

I'm having an odd problem With Trace.WriteLine not producing any output. I've traced the code and Trace.Writeline is definitely getting called, but no output is appearing in the Output window or in SysInternals' DebugView. Is something wrong with my…
Tim Long
  • 13,508
  • 19
  • 79
  • 147
3
votes
2 answers

Exception reading process info, via Process.GetProcesses(string), from Windows 7

I'm having trouble with an established production .NET2 service. The service collects process information and log files from various target computers. It runs at 80 sites without issue; mostly on Windows 2000, Windows XP, and Windows 2003. Now,…
Chorizo Omelet
  • 101
  • 1
  • 5
3
votes
1 answer

Is it safe to use Activity.Current from multiple parallel tasks on the same thread?

When trying to implement W3C tracing which makes use of variables, such as e.g. Activity.Current.SpanId, the following question came up. The official documentation for the static property Activity.Current says: Gets or sets the current operation…
Joerg
  • 790
  • 2
  • 10
  • 23
3
votes
0 answers

Why multiple log files are getting created with GUID using System.Diagnostics c#

Possible Duplicate: TextWriterTraceListener and trace filenames with GUIDs I am using System.Diagnostics to trace the each n every method in my application. Tracing is working fine in the desired log file i.e xyz.log but at the same time multiple…
Tarun
  • 393
  • 1
  • 6
  • 22
3
votes
1 answer

C# System.Net trace log - only trace one method and ignore others?

I'm using System.Net tracing as described here: http://ferozedaud.blogspot.com/2009/08/tracing-with-systemnet.html But that traces every request made with HttpWebRequest. The trace file is huge. I only want to trace what happens when I am calling…
JK.
  • 21,477
  • 35
  • 135
  • 214
3
votes
1 answer

How to configure Application Insights for different environments?

I have a multi-tier web application that has been moved to Azure, however I would like to know how I can configure application insights for multiple environments as I have 3 separate resource groups for DEV, QA, and PROD. In each would like to have…
Donald N. Mafa
  • 5,131
  • 10
  • 39
  • 56
3
votes
1 answer

System.Diagnostics.Trace Overhead

I have an application that uses Trace.WriteLine in nearly every method it uses. The program has several different problems. What I am wondering is if there is any overhead that comes with using System.Diagnostics.Trace.WriteLine so often? I am…
Security Hound
  • 2,577
  • 3
  • 25
  • 42
3
votes
0 answers

Any way to get System.Diagnostics.Process to respect Linux user's secondary groups?

Help! Running .NET CORE on Linux. I am having problems opening a file that I have read-access permissions to based on a secondary group in Linux. In order to test this, I simply execute the Linux command "id" for the current user: var proc = new…
PKCS12
  • 407
  • 15
  • 41