是否可以在 Visual Studio 中将引用从一个项目复制/粘贴到另一个项目?

发布于 2024-12-25 01:38:40 字数 68 浏览 2 评论 0原文

有没有一种方法或工具可以让您从一个项目复制一些引用并将它们粘贴到另一个项目中,这样我就不会再使用“添加引用”来打扰自己了?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

酷炫老祖宗 2025-01-01 01:38:40

是的,您可以使用 Power Commands 扩展在 VS2010 中复制和粘贴引用。

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

梅窗月明清似水 2025-01-01 01:38:40

我在 Visual Studio 2013 Preview 中遇到了同样的问题。我还找不到任何“电源命令”扩展,所以我手动完成了。

  1. 卸载源项目。
  2. 编辑复制
  3. 列出标签的标签标签的内容。
  4. 卸载目标项目
  5. 编辑
  6. 找到标签并粘贴
  7. 加载项目。

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.
春庭雪 2025-01-01 01:38:40

简单的解决方案 - 对于外部库

  1. 单击“添加引用”。

  2. 点击“浏览”。

  3. 导航到包含其他项目的文件夹。然后,转到/project-name/bin/debug

  4. 突出显示所需的 dll,然后单击“添加”。

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.

总以为 2025-01-01 01:38:40

如果您无权访问 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.

半寸时光 2025-01-01 01:38:40

右键单击参考文献(可以多次选择)->复制参考。

更改项目/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.

梦年海沫深 2025-01-01 01:38:40

我认为在 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'..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文