visual-studio 当 .proj 文件发生变化时,有没有办法让 Visual Studio 重新加载所有项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1376917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:57:54  来源:igfitidea点击:

Is there any way to get Visual Studio to reload all projects when the .proj files have changed?

visual-studiovisual-studio-2008

提问by Glenn Slaven

If I do an svn update while I have Visual Studio open and a number of project files have changed (but not the solution file) I have to wait and click yes on the reload project dialog box every time. Sometimes this can take a while depending on how many projects have changed and how slow my pc is being.

如果我在打开 Visual Studio 时执行 svn 更新并且许多项目文件已更改(但不是解决方案文件),我必须等待并每次在重新加载项目对话框中单击“是”。有时这可能需要一段时间,这取决于有多少项目发生了变化以及我的电脑有多慢。

Is there a way to say 'reload all' after the first dialog pops up, like holding down shift to force no to all in the Windows Explorer dialog? (note: I already tried this, it doesn't work)

有没有办法在第一个对话框弹出后说“重新加载所有”,比如在 Windows 资源管理器对话框中按住 shift 强制不全部加载?(注意:我已经试过了,它不起作用)

采纳答案by X-Cubed

Use a tool like VisualSVNto automate the process for you. It allows you to perform the update within Visual Studio, then automatically reloads the projects that have been modified.

使用VisualSVN 之类的工具为您自动化该过程。它允许您在 Visual Studio 中执行更新,然后自动重新加载已修改的项目。

回答by KoenJ

if you install this plugin from the visual studio gallery:

如果您从 Visual Studio 库中安装此插件:

http://visualstudiogallery.msdn.microsoft.com/d491911d-97f3-4cf6-87b0-6a2882120acf/

http://visualstudiogallery.msdn.microsoft.com/d491911d-97f3-4cf6-87b0-6a2882120acf/

The button "Reload all" appears.

出现“全部重新加载”按钮。

Regards, Koen

问候, 科恩

回答by Luke

Deleting my solution_name.v11.suofile (hidden file stored in same location as solution file) seemed to do the trick.

删除我的solution_name.v11.suo文件(隐藏文件存储在与解决方案文件相同的位置)似乎可以解决问题。

回答by sbi

Unfortunately, VS doesn't come with a way to do this. A probable workaround is to touch the solution file before activation VS. It would then reload the whole solution.

不幸的是,VS 没有办法做到这一点。一个可能的解决方法是在激活 VS 之前接触解决方案文件。然后它会重新加载整个解决方案。

There must, however, be ways to do this programmatically, since I remember CMake solutions asking me whether I wanted to reload the whole solution after individual projects were re-generated. CMake is Open Source, so if you're really desperate, you might want to look into it.

但是,必须有以编程方式执行此操作的方法,因为我记得 CMake 解决方案询问我是否要在重新生成单个项目后重新加载整个解决方案。CMake 是开源的,所以如果你真的很绝望,你可能想研究一下它。

回答by ajamrozek

I got my project to bind in my solution by closing the solution (File -> Close Solution) then reopening it.

通过关闭解决方案(文件 -> 关闭解决方案)然后重新打开它,我让我的项目绑定到我的解决方案中。

回答by Aathreya

If your project is hosted on a TFS, then delete the solution file and get latest. VS will prompt you to Reload all projects. Press Reload All.

如果您的项目托管在 TFS 上,则删除解决方案文件并获取最新信息。VS 会提示你重新加载所有项目。按全部重新加载