Solved

Call Stack During Design Time?

Posted on 2009-07-10
6
162 Views
Last Modified: 2013-11-26
Is there a way to quickly see the call stack for a function when you're not in run time in Visual Studio?  It would be nice to hover inside a method and see the different places it coud be called from instantly.
0
Comment
Question by:NigelRocks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 39

Accepted Solution

by:
abel earned 400 total points
ID: 24826082
I assume you mean that you want to see the call stack as if you hit a breakpoint in a function while you use a control in design time? Though you don't mention whether this is for a usercontrol in ASP.NET or for a windows forms usercontrol, in both cases it is needed that your control is inside a separate project, i.e., a class library. Select debug build and assign the debug version to your forms project.

Then you simply add a breakpoint and the breakpoint will be hit.

I'm not entirely sure, but I do remember that something like Debbugger.Break() (on the line where you want your breakpoint) also worked when it wasn't in a separate project, but I'm not entirely sure.

-- Abel --
0
 
LVL 39

Assisted Solution

by:abel
abel earned 400 total points
ID: 24826159
Btw: it is always possible to use reflection to dynamically call the stack (or raise + catch an exception and use the ex.stackTrace) and log that to a file. This will also work when the usercontrol is inside the current project. It will, however, not work with Debug.WriteLine or Console.WriteLine. Why not is beyond me, but these only work when you put it in a separate project.

Incidentally, I'm working on an in-depth article that describes design time vs user/run time on my blog, because if you need to run code based on one of these conditions, Control.DesignTime will not always give what you want.
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 100 total points
ID: 24826636
Right click on the Method Name and select "Find All References".  Then you should find the "Find Symbol Results" Panel down below with a Tree of every "reference" to the thing you searched for.  Double click on each entry to jump there in the code.

Here is an example of what it might look like:
FindAllReferences.jpg
0
Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

 
LVL 39

Expert Comment

by:abel
ID: 24826938
Is that a stack, Idle? (just wondering)
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 24827443
A stack?...definitely not.  =)

I think NigelRocks is just using the wrong terminology.

I was going off his description of what he wanted:

    "It would be nice to hover inside a method and see the different places it coud be called from instantly."

The "Find All References" search results will show all the different places in the code where the method is being called.
0
 
LVL 1

Author Closing Comment

by:NigelRocks
ID: 31602208
Idle_Mind, maybe I didn't word things right, so I gave you points anyway.  I've been using the "find all references" and found it somewhat helpful, but what I was really look for is an order of execution without being in run-time.  Why?  I suppose it's because I'm just too damn lazy to hit "F5" on my keyboard.
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question