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

Get name of project from where dll is referenced via code

I'm making a class library project in C#. How to get the name of the project which will call the method from my class library? I tried with Reflection: System.Reflection.Assembly.GetExecutingAssembly() and with GetCallingAssembly but it didn't…
petko_stankoski
  • 10,459
  • 41
  • 127
  • 231
2
votes
2 answers

How to enable and get Perfromance counters for Window Azure

I have developed one web application for monitoring azure application (Webrole) by console(EXE) application attaching in startup task with azure application and that EXE will send data periodically for cpu usage, memory and asp.net total session,…
Arun Rana
  • 8,426
  • 14
  • 67
  • 107
2
votes
1 answer

How do you use System.Diagnostics.TextWriterTraceListener to log to a file in C#? Are my configuration files broken?

I'm new to C# and am trying to add the ability to log messages to a file - I've been trying to figure it out for a few hours, but, I'm not very good at this. I don't know very much about assemblies, solutions, App.config, .csproj, etc., and all of…
bp256r1
  • 133
  • 1
  • 7
2
votes
1 answer

Adding global tags with System.Diagnostics.Metrics & OpenTelemetry

I might have missed it in the documentation, but I just can't find a way to do it. I'm looking for a way to globally set some tags/labels that will be added to all metrics in my service. Motivation: I have multiple DCs and multiple environments in a…
Eugene Krapivin
  • 1,671
  • 2
  • 17
  • 32
2
votes
0 answers

Block infinite loop between System.Diagnostics calls from .Net's logging code, and System.Diagnostics->ILogger listener

I have a large >10 year old web app which I'm gradually upgrading to Entity Framework 7, .Net 7 and ASP.Net Core. I'm in the middle of this big piece of tech debt payoff. I think (hope) I'm about 80% done... So there's only the other 80% to do…
2
votes
1 answer

.NET HTTP POST request observer

I want to log all HTTP requests done by System.Net.Http.HttpClient in my application. Important note: I also need to log requests done by third-party packages implemented on top of System.Net.Http.HttpClient. Which means I can't do some tricks…
nyan-cat
  • 610
  • 5
  • 19
2
votes
1 answer

System.Diagnostics.Activity- Parent/Child relation doesnt work when using multiple Threads

I have a problem that when parent activity is started by another thread, then the main thread wont see this activity, and next Activities that supposed to be children activities that are being created in main thread, wont be added to the parent…
Bartosz Olchowik
  • 1,129
  • 8
  • 22
2
votes
2 answers

Custom TraceListener and multiple messages

I'm having some difficulity with a custom TraceListener. The issue is that writing a single trace line produces two calls, one to Write(), the other to WriteLine(). The call to Write() contains the trace source, level, and event id. The call to…
mfanto
  • 14,168
  • 6
  • 51
  • 61
2
votes
0 answers

Regarding the removal of /dev/diag Interface

everyone I am currently reviewing the use of Diag Interface for SM-G988U Deveice(Android 11). However, if i check the inside of the kernel, the existing /dev/diag has been removed. We obtained an open source through the terminal manufacturer, and…
김종현
  • 31
  • 2
2
votes
1 answer

Creating Real-Time Input & Output Stream To Command Prompt in C#

General Question How would one create a direct input / output stream to and from an instance of command prompt (cmd.exe) using some form of a C# application, whether it be WinForms, WPF, or UWP. Effectively using CMD as if it were just a compiled…
Not316tb
  • 23
  • 3
2
votes
3 answers

Is there a way to get a list of processes running on a local virtual machine?

I've got a virtual machine running on Windows 7 called "VirtualXP-12345". I tried using System.Diagnostics.Process.GetProcesses("VirtualXP-12345") from the host machine but that doesn't work. I just get InvalidOperationException("Couldn't…
Mark Lakata
  • 19,989
  • 5
  • 106
  • 123
2
votes
1 answer

Can you send resources to a process in a self-contained, single file application in .NET 5?

I'm trying to include a .CHM (Microsoft Compiled HTML help) documentation file in my WPF application. It is set as a Resource in my application. I use .NET 5 and I want to create a self-contained application using single file deployment. When I have…
Tom
  • 37
  • 1
  • 6
2
votes
1 answer

Adquiring a SOAP trace for debugging is not woking

I am using Docusign API to create and retrieve "envelopes" for signing. (docusign.com for more info). Basically i am having some issues trying to adquire a SOAP trace based on their instructions…
Tony
  • 21
  • 3
2
votes
2 answers

Id from Process.Start match sometimes or sometimes not

I'd like to run from C# code ANSYS Fluent exe file And now for comparison, I'll give two examples Process fluent = Process.Start(@"C:\Program Files\ANSYS Inc\v130\fluent\ntbin\win64\fluent.exe", @"2ddp file.jou"); Process browser =…
Saint
  • 5,397
  • 22
  • 63
  • 107
2
votes
1 answer

Is there a way to check failed memory with c in windows/linux?

We know eventually everything is transistors which have state 0 and 1. And the transistor may be damaged sometimes. Can we test if there's any bit of defect transistors in the memory? I think it's similar for hardware or anything else.
compile-fan
  • 16,885
  • 22
  • 59
  • 73