Search code examples
visual-studiovisual-studio-2010referenceprojects-and-solutions

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.


Solution

  • 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.