views:

789

answers:

2

In Visual Studio there is a way to have a file in another project that is a shortcut to the first so that it builds in both. How do I do that?

+9  A: 

Right-click the project, select Add > Existing Item, and in the dialog drop down the Add button and select Add As Link.

itowlson
Although I up-voted the solution itowlson posted, as that was what I was trying to do and what I think the poster was asking, it's worth considering the alternative to this, if possible, which is to include the project that holds the file as a reference (using the Add Reference dialog, and the Project tab within that).Then put a using statement in your file (if c#), and use that namespace direct.R
Retne
Will not work in Visual Studio 2010.
Mendy
Mendy: are you sure? I'm using this exact technique on a VS2010 project at the moment, so it's definitely working for me.
itowlson
@itowlson: it's perfectly working solution. when you have the same classes to be used in Silverlight and .NET, you could just create a silverlight project assembly with the files in it and then create a .net project with links to the files in silverlight project. code reuse at its best.
pencilslate
A: 

Are you talking about a solution with multiple projects? In that case answer would be using Project Dependencies (within Project menu).

Szere Dyeri