Primoz
Primoz

Reputation: 4321

How to add reference to another project in the same solution?

I have two projects in my solution. First project is web site (actually web service) and other project is console app.

Is it possible to add reference in second project to the first one ? Under web site project I have some code I'd like to use it in console app.

I can add reference from web site to the second console project but I don't need nor want this. This second project is just for some testing purposes.

Upvotes: 2

Views: 4028

Answers (2)

pooks
pooks

Reputation: 1

Ran into the same scenario. You need to open 2 instances of Visual Studio, load up your solution in both as administrator, debug your web service in the 1st instance, then add the service reference in the 2nd instance to your console project.

Upvotes: 0

Hans Olsson
Hans Olsson

Reputation: 54999

You should create a third project, of the type Class Library. And then you make both the other projects reference that.

As it says on this MSDN page about the available project templates: Use the Class Library template to quickly create reusable classes and components that can be shared with other projects.

Upvotes: 3

Related Questions