views:

15

answers:

3

Hi, 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.----

A: 

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.

steinar
the problem is not the solution but the Web app project which reference another project. the other solution has the same web app project but I want the web app project in the second solution to reference a dll instead. changing the reference in the web app will affect the behovior in the two solutions. I hope it is clear. thanks for your help
Youssef
A: 

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.

sgmeyer
This the problem i want to solve as you said "Changes to the project in either solutions will effect the project in the other solution since they are the exact same project files." ;i want the reference to be solution dependant may be thru some conditions in .vbproj
Youssef
A: 

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.

Youssef