文章出處

自從使用Visual Studio 2013之后,多次遇到這個惱人的“Waiting for a required operation to complete...”問題。

問題發生于在Visual Studio 2013中復制/粘貼的時候。問題發生后,Visual Studio 2013停止響應,狀態欄一直顯示“Waiting for a required operation to complete...”,只能通過任務管理器強制結束Visual Studio進程,帶來的后果是——所有未保存的代碼全部丟失

本來以為是Visual Studio 2013帶來的新問題,后來在MSDN中發現原來這是一個歷史悠久的問題,至少在Visual Studio 2008時代就出現了,詳見:http://msdn.microsoft.com/en-us/library/8037k9sb(v=vs.90).aspx,而更值得關注的是這篇MSDN內容下面的評論:

Why on earth is the message so vague??
This is another instance of a longstanding problem with progress and error messages that Microsoft seems totally blind to. They say things like "the system cannot find the file specified", or "Visual Studio is waiting for a required operation to complete": with a tiny bit more effort , the messages could refer specifically to what is happening (e.g. "the system cannot find the file specified with name abcdef.dll" and this would make the problem so much easier to solve! However, despite having pointed out this problem several years ago in feedback, the problems are still there, even in code written recently...

這里說“歷史悠久的問題”,不是指引發“Waiting for a required operation to complete...”的原因,而是這個提示信息本身——提示信息太籠統,對定位問題一點幫助沒有。上面的評論抱怨就是這個。

MSDN中提到的Visual Studio 2008中的這個問題是防病毒軟件引起的,但我在Visual Studio 2013中遇到的問題不是這個原因,因為電腦上根本沒有安裝防病毒軟件。

stackoverflow上了解這個問題更多是某些VS插件(Add-in)引起的:

It is a very generic diagnostic. It is triggered by COM, heavily used in Visual Studio to implement extensibility. The underlying trigger is the IMessageFilter interface. The trigger occurs when COM marshals a method call to another thread and that call doesn't complete for 60 seconds.

There's little value in the actual notification, it is telling you something you already know. By the time 60 seconds have passed, you typically already have noticed things are not working well. Short from the wee bit of useful knowledge that Visual Studio isn't actually completely dead. The call however has to complete before VS gets usable again. There's little you can do but tap your foot and wait.

This problem is almost always caused by an add-in. Resharper is certainly a good candidate. You find the trouble-maker by disabling the add-ins one-by-one until the problem disappears. It is the kind of problem that's common with new versions of Visual Studio, it takes the add-in vendors a while to get the bugs and hangups ironed out. Contact the vendor for support and in general look for updates that may solve the issue.

而我的電腦上的VS2013只安裝了兩個插件——Git Extensions與TestDriven.Net。

如果真是VS插件引起的,目前只能懷疑Git Extensions,這有待進一步驗證。

【相關鏈接】

奇怪的Visual Studio 2013停止響應問題


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()