Trace across AppDomains

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




If this is simple, forgive my ignorance, but I'm coming from the
CompactFramework where we don't use AppDomains. I did a fair bit of archive
searching and couldn't find an answer.

I have a desktop app (FFx 2.0) developed with Studio 05 that loads
assemblies in a separate AppDomains from the primary UI. I'd like to be
able to hook up a TraceListener in the UI AppDomain and then get information
to it from Trace.Write in the other AppDomains.

I realize that the Trace data exists inside the individual AppDomains, but
Studio itself seems to have no problem receiving and displaying the Trace
statements from all AppDomains that I'm running, so I know that doing this
is possible.

Is there some general practice or pattern that would allow me to get the
Trace info from all AppDomains (within my actual process is fine)?


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com





.



Relevant Pages

  • Re: Trace across AppDomains
    ... depends on the underlying store for the class that derives from TraceListener. ... Of course, this is assumed, since the trace methods can be called from any thread in the app domain. ... Because of that, when creating your new AppDomains, pass the TraceListener to your app domain and then add it to the TraceListeners in the new app domain. ... These assemblies are each hosted in a separate AppDomain and called through a remoted interface. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Trace across AppDomains
    ... These assemblies are each hosted in a separate AppDomain and ... So if I load up the UI, and it in turn loads up an assembly through remoting ... AppDomains currently running under the debugged process. ... If you truly have Trace data happening in a separate AppDomain, ...
    (microsoft.public.dotnet.languages.csharp)
  • Trace across AppDomains
    ... CompactFramework where we don't use AppDomains. ... Studio itself seems to have no problem receiving and displaying the Trace ... Chris Tacke, Embedded MVP ...
    (microsoft.public.dotnet.languages.csharp)