如何删除VS2010“检测到文件修改”对话框?

时间:2010-09-28 10:16:21

标签: visual-studio-2010

每次我在git中切换分支时,visual studio都会用those popups让我生气,问我是否要重新加载项目或忽略更改。

如何自动重新加载解决方案?

3 个答案:

答案 0 :(得分:6)

尝试VSCommands 2010 Lite,它允许您重新加载所有项目:

enter image description here

答案 1 :(得分:3)

我发现这也很烦人,所以我自己寻找解决方案。并提出了我编写的一个小控制台应用程序,其代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;


internal class Program
{
  // For Windows Mobile, replace user32.dll with coredll.dll
  [DllImport("user32.dll", SetLastError = true)]
  static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

  // Find window by Caption only. Note you must pass IntPtr.Zero as the first parameter.
  [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
  static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);

  [DllImport("user32.dll")]
  //      static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommands nCmdShow);
  static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

  internal static void Main(string[] args)
  {
     do
     {
        Console.Title = "Waiting...";
        Console.WriteLine("Waiting...");
        IntPtr hwnd = FindWindowByCaption(IntPtr.Zero, "File Modification Detected");
        while ((int)hwnd == 0)
        {
           Thread.Sleep(500);
           hwnd = FindWindowByCaption(IntPtr.Zero, "File Modification Detected");
        }

        Console.Title = "Found one, kill it...";
        Console.WriteLine("Found one, kill it...");
        // ShowNormal = 1
        // Show = 5
        ShowWindow(hwnd, 5);
        SendKeys.SendWait("{ENTER}");
        Thread.Sleep(500);
        hwnd = IntPtr.Zero;
     } while (true);

  }
}

如果你启动这个程序,它会等待那些弹出窗口,并自动点击重新加载。

答案 2 :(得分:1)

我完全同意。我无法相信他们没有在VS 2010中修复它。

但仅仅是一个FYI:

关闭此Microsoft Connect

这个似乎仍然活跃并且有一个解决方法(这对我来说不值得):Microsoft Active

我想这可以告诉你微软如何认真对待这个: 问题从5年前开始仍未解决:283618