Youssef
Youssef

Reputation: 728

How to reference a project from a web application in two different Solution

I have a Web application project that references other projects within the same solution. I wanted the web application to reference the same project but from a static folder in a different solution.

something like this:


Solution A ---> ---->Web App ------>Reference to proj


Solution B-----> ------->Web App ------->Reference proj1.dll (static)

I would appreciate any help and suggestions.

Thank you.----

Upvotes: 0

Views: 186

Answers (3)

Youssef
Youssef

Reputation: 728

I fixed the problem by using Conditions in the vbproj.

something like this: &lt ItemGroup Condition=" '$(Configuration)|$(Platform)' != 'Developers|AnyCPU' "> &lt ProjectReference Include="..\xxxx"> &lt/ProjectReference > ........

&lt /ItemGroup> &lt ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Others|AnyCPU' "> &lt Reference Include="Foo, Version=1.0.0.0, Culture=neutral, ProcessorArchitecture=MSIL"/> .......... &lt /ItemGroup>

~ Hope it helps someone else.

Upvotes: 1

sgmeyer
sgmeyer

Reputation: 645

Basically the SLN file is just meta data defining the location of references, projects, and other meta data about the solution. A project can easily be added to multiple solutions.

  1. Right click on the Solution in the visual studio solution explore.
  2. On the menu go to Add > Existing Project...
  3. Select the project you want to add to the solution.

Now the project belongs to both solutions. Changes to the project in either solutions will effect the project in the other solution since they are the exact same project files.

Upvotes: 0

steinar
steinar

Reputation: 9653

Either add that project to Solution B too (add existing project) or right click References, select Add Reference and browse for the compiled DLL. It doesn't have to live in the solution folder structure.

Upvotes: 0

Related Questions