25

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?

1

6 Answers 6

13

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

4
  • 5
    For VS2012 and 2013, this command is available in Productivity Power Tools, links: 2012 & 2013 Commented Apr 27, 2015 at 8:31
  • 1
    That was sooo easy! I have wanted to be able to do this for years! Thanks for the awesome tip @BeytanKurt! Commented May 6, 2015 at 2: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. Commented Dec 4, 2017 at 7: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
    Commented Nov 13, 2020 at 3:30
10

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.
2
  • Productivity Power Tools 2013 will let you do this now.
    – Jeff Ogata
    Commented Oct 9, 2014 at 21:08
  • Jeff Ogata I tried that, and it throws an error when Pasting References for me. Commented Feb 20, 2019 at 12:24
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.

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.

1
  • 1
    I copied the itemgroup-section which contained "Include="Service References". It worked for me in Vb.net. Thanks.
    – etalon11
    Commented Nov 22, 2016 at 9: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.

1
  • 1
    This is not help at all for Web References to services.
    – David Chen
    Commented Nov 19, 2014 at 13:17
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'..

1
  • I see Copy option is disabled in VS2010
    – codemirror
    Commented May 3, 2019 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.