.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CLR Inside Out: Extending System.Diagnostics

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

The System. Diagnostics namespace in the Microsoft® . NET Framework contains powerful tracing capabilities. This includes the main tracing API: TraceSource. As you will see, the tracing APIs in System.

Krzysztof Cwalina

MSDN Magazine April 2006

View Complete Post

More Related Resource Links

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

CLR Inside Out: Production Diagnostics Improvements in CLR 4


The Common Language Runtime (CLR) 4 includes new APIs that expand diagnostic support toward the production end of the spectrum. We explain how the debugging APIs support dump debugging for application crash and hang scenarios and make it easier to detect when hangs are caused by multi-threading issues.

Jon Langdon

MSDN Magazine May 2010

CLR Inside Out: Extend Windows Forms Apps Using System.AddIn


See how Windows Forms applications can be adapted to use the new .NET Add-in framework (System.AddIn) this month.

Mueez Siddiqui

MSDN Magazine July 2008

Advanced Basics: Monitor Your Apps with System.Diagnostics


It never fails. The application you just deployed ran great on your development machine-but stumbles in production. The problem might show up right away or maybe it creeps up over time. Now what?

Brad McCabe

MSDN Magazine July 2006

Inside MSDN: Building the MSDN Aggregation System


Have you visited msdn2. microsoft. com? It's the new online face of the MSDN® Developer Tools and Enterprise Server documentation. The infrastructure behind it includes a system developed by my team at Microsoft for aggregating information related to our content.

John Mollman

MSDN Magazine July 2006

Issue on System.Diagnostics.Process output

I am getting the following error message System.InvalidOperationException: StandardOut has not been redirected or the process hasn't started yet. for the below code which has to displays the Output of the command prompt command: Process p = new Process(); string result = ""; p.StartInfo.WorkingDirectory = "C:\\WINDOWS\\system32"; p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.Arguments = "/C ipconfig"; StreamReader stdOut = p.StandardOutput; p.WaitForExit(); p.Start(); result = stdOut.ReadToEnd(); if (!p.HasExited) { p.Kill(); } stdOut.Close(); p.Close(); Response.Write(result); System.Threading.Thread.Sleep(5000); Please help guys. Is I am doing correct. 

System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server

System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server 

Exception in System.Diagnostics.EventLog.get_EntryCount()

Hello,I am having an really weird exception which seems to originate in the BCL since the call stack does not show any of my code.Application is an event log processing service which uses the EntryWritten event of the System.Diagnostics.Eventlog class.The exceptions call stack is as follows:[System]System.ComponentModel.Win32ExceptionInterface unknownat System.Diagnostics.EventLogget_EntryCount()at System.Diagnostics.EventLogCompletionCallback(Object context)at System.Diagnostics.EventLogStaticCompletionCallback(Object context, Boolean wasSignaled)at System.Threading._ThreadPoolWaitOrTimerCallbackWaitOrTimerCallback_Context(Object state, Boolean timedOut)at System.Threading._ThreadPoolWaitOrTimerCallbackWaitOrTimerCallback_Context_f(Object state)at System.Threading.ExecutionContextRun(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading._ThreadPoolWaitOrTimerCallbackPerformWaitOrTimerCallback(Object state, Boolean timedOut)Thats it. No sign of my own code. Yet, this happens like once or twice a day only, and ONLY on a Windows Vista SP1 installation. Anybody has any ideas whats that where it comes from, etc?CheersAndreas

Process (System.Diagnostics.Process) invoked by aspx hangs on iis6 / win2003

Hello all, I've encountered a problem trying to run an external exe from an aspx page. My code works fine when running under visual studio and also when running under iis7 on windows server 2008 SP1. It does not work on iis6 on windows 2003 sp2: 1. The executable is loaded and uses 560k or so of memory 2. The executable does not use any cpu 3. The executable does not appear to enter Main()  4. The invoking code hangs at WaitForExit() I've tried using different executables including a dummy that simply returned and that did not make any difference. I'm pretty sure that the credentials being used for the executable are correct because if I fudge the password, the process reports a login failure. I'm pretty sure that output blocking to the standard out and standard error streams is not the issue as a) it works on iis7 and b) when I first suspected this as the cause, I re-wrote the aspx to launch threads to read the streams. I've tried invoking my exe directly and via cmd.exe and that makes no difference. Anyway, if anyone has any ideas on this, it would be greatly appreciated. I've included a snippet of my code below. Thanks in advance... ...Beau                     // Create a new process to invoke the console app                     usi

System.Diagnostics not working in IIS 6: Urgent

Hi All, I have developed a ASP.NET C# web page which connects to remote conmputer command prompt using PSEXEC.exe and executes some command where the output of the command will get copied to the page. It works fine in the VS 2005 IDE. If the page is accessed via IIS from IE, the task PSEXEC.EXE appears in task manager of the server with the system account privilege after the method is triggered but nothing happens. Please find my present settings in IIS and others: 1. APP Pool Identity to Local System (Predefined) and also to a configurable admin account. 2. <processModel userName="SYSTEM" password="AutoGenerate" /> in Machine.Config file Also I've tried impersonasation in web.config file to an admin account. I am not able to sort this problem, please help. I've tried a lot spending more time. Code Is:Process p = new Process(); string result = ""; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = @"C:\psexec.exe"; p.StartInfo.Arguments = @"\\nawrkxp613 -u domain\usename -p Password1 cmd.exe /c ipconfig"; p.Start(); StreamReader stdOut = p.StandardOutput; p.WaitForExit(); result = stdOut.R

what is the use of System.Diagnostics namespace classes



what is the use of  System.Diagnostics namespace classes

what is the use of System.System.Diagnostics namespace classes

what is the use of  System.System.Diagnostics namespace classes

Extending LOB system with SharePoint


I'm extending an LOB enquiry system with SharePoint.

My design has enquiries as a list assiciated with the relevent subsite (regonal office). When adding an item to this list (approx 100 per month), a web service call needs to be made to the LOB system to create the enquiry in that system (passing in a couple of fields from the list). This will return the LOB identifier which I will then store in the SharePoint list.

At a later point, when viewing this enquiry, another web service call will be made to retrieve information from LOB system for a particular enquiry.

BCS seems logical for the second requirement, but how about the first? Is that feasable using BCS? Any pointers? Any other suggestions, I can't see this as being an unusual desire. surely lots of SharePoint systems need to integrate with external systems, I've just never worked on one myself. Any web links for someone who's done something similar themselves?


system.diagnostics not logging


I need to trace the message traveling into a web service.  I have successfully configured system.diagnostics and system.servicemodel  message logging on my development workstation but when I transfer those settings to my live environment I am not getting any .svclog output.

I added:

     <!--source name="System.Runtime.Serialization">
         <add name="SerializationListener"/>
     <source name="System.ServiceModel.MessageLogging" switchValue="Verbose">

System.Diagnostics.Process and Acrobat Reader

If I already have any PDF file being displayed in Adobe Reader, making the call System.Diagnostics.Process proc = Launch(sUniqueName, sPath, true, m_iWaitNone), then immediately examining proc.HasExited would indicate true, although the "sUniqueName" PDF would still be open.  This can't be correct!?

If I don't have any PDF files open before making the call, "sUniqueName" would be open, and examining proc.HasExited would indicate false... which is correct.  This is very repeatable.  Why would proc.HasExited = true when the PDF is still being displayed just because another PDF was opened prior to the call?

Thanks for any insight... this is driving me crazy!   :-P



Code follows:

      #region Launch()
        public System.Diagnostics.Process Launch(string sFilename, string sArgs, bool bCreateWindow, int iWaitMode)
            const int ERROR_FILE_NOT_FOUND = 2;
            const int ERROR_ACCESS_DENIED = 5;

            System.Diagnostics.Process proc =

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend