简体   繁体   English

一次更新解决方案中所有项目的参考路径

[英]Update reference paths for all projects in a solution at once

I need to add a reference path to all projects (over 35 projects) in a solution.我需要为解决方案中的所有项目(超过 35 个项目)添加参考路径。 Doing this manually would be time consuming.手动执行此操作将非常耗时。

Is there a way to update/add/remove reference paths for all the projects programmatically?有没有办法以编程方式更新/添加/删除所有项目的引用路径?

I found an add-in that helps in what I need but unfortunately the add-in's download link is broken.我找到了一个可以满足我需要的加载项,但不幸的是加载项的下载链接已损坏。

You could always open the csproj files in a text editor an perform a find/replace.您始终可以在文本编辑器中打开 csproj 文件并执行查找/替换。 Notepad++ has a handy replace in files feature . Notepad++有一个方便的文件替换功能

Using Visual Studio PowerCommands you can copy and paste references, so it won't be as tedious, at least.使用Visual Studio PowerCommands ,您可以复制和粘贴引用,因此至少不会那么乏味。 It makes many other things less tedious as well.它也使许多其他事情变得不那么乏味。

If your reference is one the NuGet packages , you can easily use the NuGet package manager for the solution and select the installed package that you want to remove, check desired projects, then uninstall them. If your reference is one the NuGet packages , you can easily use the NuGet package manager for the solution and select the installed package that you want to remove, check desired projects, then uninstall them.

for installation: first, select the desired package, check target projects, then click install.安装:首先,select 所需的 package,勾选目标项目,然后点击安装。

its work for me as I have a solution with 35 projects.它对我有用,因为我有一个包含 35 个项目的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM