是否可以在 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
是的,您可以使用 Power Commands 扩展在 VS2010 中复制和粘贴引用。
Yes, you could use the Power Commands extension to copy and paste references in VS2010.
我在 Visual Studio 2013 Preview 中遇到了同样的问题。我还找不到任何“电源命令”扩展,所以我手动完成了。
I had the same question in Visual Studio 2013 Preview. I couldn't find any "Power Commands" extensions yet, so I did it manually.
简单的解决方案 - 对于外部库
单击“添加引用”。
点击“浏览”。
导航到包含其他项目的文件夹。然后,转到/project-name/bin/debug。
突出显示所需的 dll,然后单击“添加”。
Simple Solution - For External Libraries
Click add references.
Click Browse.
Navigate to the folder containing the other project. Then, go to /project-name/bin/debug.
Highlight the desired dll's and then click add.
如果您无权访问 PowerCommands,请尝试在(高级)文本编辑器中打开两个项目的
.csproj
文件。.csproj
文件是 XML 文件。查找包含多个
标记的
子部分。将与要从源.csproj
文件复制的引用相对应的
标记复制到相应的
子部分在目标.csproj
文件中。如果您执行此操作时在 Visuals Studio 中打开了目标项目,VS 将注意到
.csproj
文件已更改,并会要求您重新加载该文件,单击“是”执行此操作并验证参考文献已添加到参考文献列表中。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.右键单击参考文献(可以多次选择)->复制参考。
更改项目/VS。右键单击“参考文献”->粘贴参考
但您将需要 Powercommands。
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.
我认为在
Visual Studio 2010
中是可能的,只需突出显示要复制的引用,右键单击并从菜单中选择“复制引用”..然后转到其他项目,右键单击引用项目并选择“粘贴引用”..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'..