Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / July 2004

Tip: Looking for answers? Try searching our database.

ContextBoundObject Attribute question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Claes R?dstr?m - 10 Jul 2004 19:14 GMT
Hi!

I rewrote a Custom Attribute sample to supply tracing functionality
to a context bound class thru an attribute.

The thing is that I would like to continue nested tracing inside the class,
but since a method call, in an object, that calls another method on itself
seems not to be performed thru the same context my added tracing
functionality is not called. => tracing is only performed on method calls
coming from external callers ( that passes context boundaries ?) .

Can I get around this problem ??

I want my custom tracing attribute to affect all method call
from where ever they are made.

Ideas ?

/Claes
Rick Byers [MSFT] - 14 Jul 2004 18:16 GMT
Hi Claes,
Unfortunately, there is no way (that I'm aware of anyway) to use
ContextBoundObjects to intercept method calls within the same object.  This
isn't what CBOs are designed for.

If you want a general way to trace all (or a specific subset of) method
calls, you probably want to use the unmanaged profiling API.  There is a
good MSDN Magazine article at
http://msdn.microsoft.com/msdnmag/issues/01/12/hood/ that discusses the
profiling API, and provides a sample of how to use it.  The full
documentation is included with the .NET SDK in "Tool Developers
Guide\docs\Profiling.doc".  It's a bit more complicated than using CBOs, but
it's much more powerful and efficient.

I hope this helps,
   Rick

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

> Hi!
>
[quoted text clipped - 15 lines]
>
> /Claes

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.