473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Find All References" programmatically

Hi

I'm working on some code verification tools, and I'd like to implement
pretty much the same functionality as the VS 2005 "Find All References" menu
option, in c#.

I want my code to run through some other code (or possibly the compiled
modules) that my colleagues and I have written, and find calls to specific
functions (also in our code), in such a way that I can get hold of the
parameters of the calls. I don't really want to write this as a VS add-in,
I want it to be part of the unit tests.

I've looked through the MSDN, but nothing jumps out at me as an obvious
approach. Reflection doesn't look like it would do the job (at least not
easily). I've even considered using Regex, but I'd rather examine the
compiled code than the text, if that's possible.

I've also seen the same functionality in .NET Reflector, in the Analyzer
window.

I'd be grateful for any pointers you can give me.

Cheers

Jason
Apr 11 '06 #1
2 3155
Reflection would do the job and you are right, it won't
be an easy thing to write (a comphrensive tool that is).

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Jason" <dont.spam@please_spammenot.com> wrote in message
news:44**********************@ptn-nntp-reader02.plus.net...
Hi

I'm working on some code verification tools, and I'd like to implement
pretty much the same functionality as the VS 2005 "Find All References"
menu
option, in c#.

I want my code to run through some other code (or possibly the compiled
modules) that my colleagues and I have written, and find calls to specific
functions (also in our code), in such a way that I can get hold of the
parameters of the calls. I don't really want to write this as a VS
add-in,
I want it to be part of the unit tests.

I've looked through the MSDN, but nothing jumps out at me as an obvious
approach. Reflection doesn't look like it would do the job (at least not
easily). I've even considered using Regex, but I'd rather examine the
compiled code than the text, if that's possible.

I've also seen the same functionality in .NET Reflector, in the Analyzer
window.

I'd be grateful for any pointers you can give me.

Cheers

Jason

Apr 12 '06 #2
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Reflection would do the job and you are right, it won't
be an easy thing to write (a comphrensive tool that is).

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp


Hi Robbe

Thanks for your help. I've already written some code using reflection that
can run through assemblies and work out that there are, say 2 classes X and
Y, which have member functions X.f() and Y.g() respectively.

I don't suppose there's an easy way to find out whether X.f() calls into
Y.g() at all?

Thanks

Jason
Apr 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
332
by: WalterM | last post by:
I'm setting up a script to build a C# solution, with several assemblies ( dlll's ). The script language would probably be VBScript, within a Windows Script ( .wsf ) file. The main build step is...
2
2409
by: Robin S. | last post by:
I don't have the "references" selection in my "tools" menu. Obviously this is kind of important. I have "Always show full menus" checked. Program has been updated to SP3. Any ideas as to why...
3
8407
by: Michael Rodriguez | last post by:
I've installed WSE, both 1.0 and 2.0. The namespace Microsoft.Web.Services is visible from my VB.NET projects, but not in C#. In C#, it tells me there is no "Web" under "Microsoft". Any ideas?...
0
1338
by: hansiman | last post by:
I sometimes see references to controls that has been removed from the aspx page in the code behind. The references linger in the region "Web Form Designer Generated Code" and look like Protected...
0
2785
by: Rave | last post by:
This is a long shot, but I thought I'd try it. I am currently using excel as an inventory tool. I currently have a hand-held scanner plugged into a laptop for reading barcodes. Using the "Find and...
0
1314
by: Beorne | last post by:
Up to a short time ago using "find all references" in the find symbol results appeared all the referencies of a specific string present in every source file of the solution. Now when i select...
1
1308
by: Toni | last post by:
Hello! I have a problem that I hope someone could help me with. Recently a web application was ordered from a software developer and installed on the server of my working place. This application...
4
3700
by: SpaceMarine | last post by:
hello, i am trying to figure something out. the facts: - i have an Access 2000 app that ive converted to Access 2007 (windows Vista) - it uses several external references, DLLs and an EXE....
3
3160
ChrisWang
by: ChrisWang | last post by:
Hi all, I have a simple question about "Intra-package References" There are two source files and __init__.py in package MyPkg shown below: |-MyPkg -__init__.py -example.py -test.py
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.