views:

75

answers:

3

Hi

i have 2 projects named as SQLDiscovery and TestApp like (Solution 'TestApp'(2 Projects)

Solution 'TestApp'(2 Projects) |
| ---> (SQLDiscovery) Contains a class SQLDiscover and a method DisplayLocalinstances()

---> (TestApp) which contains main()

Now i want to access DisplayLocalInstances() in main.how can i do it. Already for 2nd proj k hav chhose proj 1 as dependency project.

+1  A: 

First you have to add a reference to the project you wanna call it's method. Then make sure that the method is visible outside it's containing assembly (i.e defined inside a public class and it's marked as public itself).

Actually adding a a reference is a very trivial job, just select the client project (the project from which you will call the other project's function), right click and choose add reference, from the dialog, choose projects tab, select the project that contains the function you wanna reference, and Voila! You're all set.

Galilyou
give example for this
Cute
A: 

You must reference SQLDiscovery project in your TestApp project.

Arnis L.
give example for this one
Cute
Did you check link i gave?
Arnis L.
A: 

Thank you Sir, for your help :)

Arslan Mehmood