Profiling Add-ins?

D

Dave

Most of the profilers I've seen, JetBrains' dotTrace, Ants and NProf,
all look for a .NET exe entry point to start the profiling session. How
does one go about profiling .NET dlls that have been pulled in by
unmanaged processes, for instance Office Add-ins??
 
X

XL-Dennis

Hi Dave,

I've been playing around with a 'shimmed' COM add-in. I can't access the
unmanaged COM add-in (which share the same memory area as Excel.exe) or the
underlying managed COM add-in. The later should be in it's own AppDomain but
I lack the knowledge how to access the AppDomain.
 
D

Dave

From what I can tell all of the profilers make use of MS's .NET
profiling API, which requires an exe entry point. There's another
profiler from Sci Tech that can latch onto existing processes, but if
the parent process is unmanaged that doesn't help me.

I have a frustrating bug that comes and goes where PowerPoint persists
as a service even after I've closed the main window. This is apparently
because some resources have not been released (or so I gather from
reading similar accounts regarding Outlook AddIns) causing PowerPoint
to hang and never call OnDisconnection on my shim.

A profiler would sure come in handy at this point...
 
X

XL-Dennis

Dave,

I had the impression that the unmanaged standard COM DLL release all
reference to its host(s) when shutting down...

It's not recommended to use ReleaseComObject or FinalReleaseComObject in the
OnDisconnection event:
http://blogs.msdn.com/eric_carter/archive/2004/04/07/108898.aspx

Some basic stuff You can do:
Msgbox in OnDisconnection event to see that it kicks in.
Set all variables to Nothing in the same event.
Make sure that the latest SP for Office is installed.

I really wish that MSFT would provide us with a tool to document and track
down errors with managed COM add-ins like the one for VSTO:
http://www.microsoft.com/downloads/...54-8069-4918-A6F9-E744928DFAC3&displaylang=en
 
D

Dave

The problem did eventually go away, although I was never able to track
down the offending assembly and/or COM object that was causing
PowerPoint not to release.

And I did set up output statements to a log file that showed
OnDisconnection was never being called. All of my resources would have
been cleaned up/nulled out in that method.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top