Visual studio long compilation when replacing int with double

后端 未结 2 1204
春和景丽
春和景丽 2020-12-13 03:20

My copy of VS2013 Ultimate compiles this code for 60+ seconds:

class Program
{
    static void Main(string[] args)
    {
        double dichotomy = Dichotomy         


        
2条回答
  •  伪装坚强ぢ
    2020-12-13 03:49

    I repro, 27 seconds on my machine. The evil-doer is MsMpEng.exe, it burns 100% core for that long. Easy to see in Task Manager's Processes tab.

    This is the Windows Defender service, the one that actually performs the malware scans. Disabling it by unticking the "Turn on real-time protection" option instantly fixes the delay. So does adding the path where I store projects to the "Excluded file locations" box, probably your preferred approach.

    I'd hate to have to guess at the underlying reason, but have to assume that your source code is triggering a malware rule. Not a great explanation, I don't see the delay when I target a .NET version < 4.0. Okay, I give up :)

提交回复
热议问题