locked
SyncTracer question RRS feed

  • Question

  • I am using the framework inside a dll which is used by VB6.  I would like to use SyncTracer, but putting

    <system.diagnostics>

    <switches>

    <!-- 0-off, 1-error, 2-warn, 3-info, 4-verbose. -->

    <add name="SyncTracer" value="3" />

    </switches>

    <trace autoflush="true">

    <listeners>

    <add name="TestListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\TraceSample.txt"/>

    </listeners>

    </trace>

    </system.diagnostics>

    from http://msdn.microsoft.com/en-us/library/cc807160.aspx into the dll app.config does not result in the creation of c:\TraceSample.txt.  We use app.config in the dll, but go after it manually.

     

    Is there a way to programmatically turn on this functionality?

     

    Thank you,

    Jeff Landry

    Wednesday, November 19, 2008 10:32 PM

Answers

  • The only solution I could come up with was to embed the sync code in a standalone application.  SyncTracer worked immediately as advertized as soon as it was able to obtain access to the config file parameters.

     

    jwL

     

     

    Monday, November 24, 2008 9:09 PM

All replies

  • Hi Jeff

     

    Are you running your application in Administrator mode?  I know for some Windows versions, (ie Vista, Windows Server 2008), the OS will not allow you to write to C:\ unless you are executing your task with administrative priviledges. 

     

    Make sure you are in admin mode, or try to see if you can write to another location, which you have read/write access.

     

    I dont understand what you mean by "We use app.config in the dll, bug go after it manually." can you clarify?

     

    Also, make sure app.config is located in the same location as your executable.

     

    Maria del Mar Alvarez Rohena - MSFT

    Thursday, November 20, 2008 1:14 AM
  • Maria:

     

    Thanks for the suggestion.  However, I am pretty sure that there is a basic issue with dlls reading app.config files created in their projects.  Done a bunch of searching on this in the past.

     

    I created a stand alone application which used the sync framework and it immediately provided the trace information into the file.

     

    Thanks again,

    Jeff Landry

     

     

    Thursday, November 20, 2008 9:09 PM
  • The only solution I could come up with was to embed the sync code in a standalone application.  SyncTracer worked immediately as advertized as soon as it was able to obtain access to the config file parameters.

     

    jwL

     

     

    Monday, November 24, 2008 9:09 PM