24

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?

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
pencilCake
  • 51,323
  • 85
  • 226
  • 363
  • 1
    possible duplicate of [Can I copy some References of a project and paste it to another project's references in Visual Studio?](http://stackoverflow.com/questions/4377836/can-i-copy-some-references-of-a-project-and-paste-it-to-another-projects-refere) – pedrommuller Jun 08 '14 at 17:37

6 Answers6

13

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

Damyan Bogoev
  • 688
  • 4
  • 12
  • 5
    For VS2012 and 2013, this command is available in Productivity Power Tools, links: [2012](https://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd) & [2013](https://visualstudiogallery.msdn.microsoft.com/dbcb8670-889e-4a54-a226-a48a15e4cace) – Beytan Kurt Apr 27 '15 at 08:31
  • 1
    That was sooo easy! I have wanted to be able to do this for years! Thanks for the awesome tip @BeytanKurt! – Don Rolling May 06 '15 at 02:36
  • 1
    After installing Power Commands I still can't copy the web reference: the copy entry of the web reference context menu is disabled. – Marco Lackovic Dec 04 '17 at 07:40
  • "references" is a bit vague. I too was looking to copy web/service reference data versus adding each one back again. I don't see how that is done with Power Commands. – TravelDev Nov 13 '20 at 03:30
11

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.
Clayton Hall
  • 183
  • 2
  • 9
8

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.

Community
  • 1
  • 1
Sam K
  • 319
  • 1
  • 6
  • 13
6

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.

Yurrit Avonds
  • 294
  • 3
  • 13
  • 1
    I copied the itemgroup-section which contained "Include="Service References". It worked for me in Vb.net. Thanks. – etalon11 Nov 22 '16 at 09:28
0

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.

Manuel Rauber
  • 1,583
  • 1
  • 17
  • 39
0

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

S2S2
  • 8,322
  • 5
  • 37
  • 65