pencilCake
pencilCake

Reputation: 53303

Is it possible to copy / paste References from one project to another in Visual Studio?

Is there a way or tool that lets you to copy some references from one project and paste them to another -so that I do not bother my self again by using ADD REFERENCE?

Upvotes: 25

Views: 35291

Answers (6)

Sam K
Sam K

Reputation: 349

Simple Solution - For External Libraries

  1. Click add references.

  2. Click Browse.

  3. Navigate to the folder containing the other project. Then, go to /project-name/bin/debug.

  4. Highlight the desired dll's and then click add.

Upvotes: 8

Yurrit Avonds
Yurrit Avonds

Reputation: 406

If you do not have access to PowerCommands, try opening the .csproj files of both projects in an (advanced) text editor. The .csproj files are XML files.

Look for the <itemgroup> subsection that contains a number of <reference> tags. Copy the <reference> tags corresponding to the references you wish to copy from the source .csproj file to the corresponding <itemgroup> subsection in the target .csproj file.

If the target project was opened in Visuals Studio while you did this, VS will notice that the .csproj file has been altered and will ask you to reload the file, click 'Yes' to do so and verify that the references have been added to the reference list.

Upvotes: 6

Clayton Hall
Clayton Hall

Reputation: 181

I had the same question in Visual Studio 2013 Preview. I couldn't find any "Power Commands" extensions yet, so I did it manually.

  1. Unload the source project.
  2. Edit
  3. Copy contents of tag tag that lists the tags.
  4. Unload the target project
  5. Edit
  6. Find the tag and paste
  7. Load the projects.

Upvotes: 10

S2S2
S2S2

Reputation: 8502

I think its possible in Visual Studio 2010, just highlight the references you want to copy, right click and select 'Copy References' from the menu..and then go to the other project, right click the References item and select 'Paste References'..

Upvotes: 0

Manuel Rauber
Manuel Rauber

Reputation: 1392

Right click on the reference (you can select more than once) -> Copy Reference.

Change Project / VS. Right-Click on "References" -> Paste Reference

But you will need Powercommands for that.

Upvotes: 0

Damyan Bogoev
Damyan Bogoev

Reputation: 696

Yes, you could use the Power Commands extension to copy and paste references in VS2010.

Upvotes: 13

Related Questions