Cute
Cute

Reputation: 14011

How to call one project from in another in vs2005

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.

Upvotes: 0

Views: 313

Answers (2)

Ahmed
Ahmed

Reputation: 11383

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.

Upvotes: 1

Arnis Lapsa
Arnis Lapsa

Reputation: 47577

You must reference SQLDiscovery project in your TestApp project.

Upvotes: 0

Related Questions