Is there some tool which can somehow extract into a file or files all the dependencies related to a given function or class.
I have often had to do this and have not found a satisfactory solution. I currently use JetBrains Resharper and specifically View Type Depencies in version 9, but even in simple cases you still have to then navigate to each dependency and copy the code. The NDepend tool is also helpful but does not perform the task completely.
The motivation for this is being able to extract a small part of code to port into another project in cases where the projects are independent, and we do not want to create dependencies between the projects. I realize that this duplicates code in the code base(s) BUT there are definitely legitimate needs for this!
(ideally free /open source but even commercial would be great)