VS2010 c# find who is calling my indexer
I was wondering if someone could help me figure out how I can find out what the calling function is to an indexer withing Visual Studio 2010. When I look at the call stack window and expand the indexer I'm watching (expand "Calls to 'this'") it shows "Searching" then says "Search开发者_运维问答 found no results". Thanks
You don't need to expand anything. When execution stops at your indexer - you'll see caller in the call stack window right at the second line (highlighted with red outline).
So, put breakpoint in the indexer, run program and wait until execution stops.
Red Gate Reflector also has an analysis tool that will find all callers (via static analysis, you don't have to interrupt the program with a breakpoint). It used to be free but isn't any longer (If you write .NET software for a living, the $35 is well worth it. For open source hobbyists, not so much.). I'm not sure if the free clone ILSpy has that ability.
精彩评论