how to monitor the program code execution? (file creation and modification by code lines etc)

Posted by infant programmer on Stack Overflow See other posts from Stack Overflow or by infant programmer
Published on 2010-05-17T15:28:30Z Indexed on 2010/05/21 5:40 UTC
Read the original article Hit count: 213

Filed under:
|

My program is about triggering XSL transformation,

Its fact that this code for carrying out the transformation, creates some dll and tmp files and deletes them pretty soon after the transformation is completed.

It is almost untraceable for me to monitor the creation and deletion of files manually, so I want to include some chunk of codelines to display "which codeline has created/modified which tmp and dll files" in console window.

This is the relevant part of the code:

            string strXmlQueryTransformPath = @"input.xsl";
            string strXmlOutput = string.Empty;
            StringReader srXmlInput = null;
            StringWriter swXmlOutput = null;
            XslCompiledTransform xslTransform = null;
            XPathDocument xpathXmlOrig = null;
            XsltSettings xslSettings = null;

            MemoryStream objMemoryStream = null;
            objMemoryStream = new MemoryStream();

            xslTransform = new XslCompiledTransform(false);
            xpathXmlOrig = new XPathDocument("input.xml");

            xslSettings = new XsltSettings();
            xslSettings.EnableScript = true;
            xslTransform.Load(strXmlQueryTransformPath, xslSettings, new XmlUrlResolver());

            xslTransform.Transform(xpathXmlOrig, null, objMemoryStream);
            objMemoryStream.Position = 0;
            StreamReader objStreamReader = new StreamReader(objMemoryStream);
            strXmlOutput = objStreamReader.ReadToEnd();
// make use of Data in string "strXmlOutput"

google and msdn search couldn't help me much..

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET