Visual Studio 2017 调试在调用 DateTime.Now 时冻结并中止;

Visual Studio 2017 debug freezes and aborts when calling DateTime.Now;

在调试时,每当我尝试以任何方式获取 DateTime 值时,例如:

camLogMessage.MsgDateTime = DateTime.Now;

if (myObj.Date < DateTime.Now.Date){}

DateTime creation = File.GetCreationTime(@"C:\test.txt");

Visual Studio 停顿了几秒钟,然后说

The network connection to MYCOMPUTER has been lost. Debugging will be aborted.

确实如此。

如果我在 QuickWatch window 中将 属性 设置为 DateTime 值,一切都会顺利进行。

VS2017,.Net Framework 4.6.2,平台目标 x64。 据我所知,我没有使用远程调试。

那会是什么?

因此,禁用 ReSharper 解决了我的问题。我不知道是什么设置组合导致的(我已经使用它很多年了,没有任何问题),但我认为是时候和 RS 说再见了。