0

Today I've ran into an issue with my super-simple Hello World program written on C#. Every time I run it my Avast antivirus activates cyber capture and doesn't let the program to execute properly (cyber capture is activated only once, but if I recomplie my project the case will repeat). This looks like this.

And here is the code of the only file in my project:

using System;
using System.Threading;

namespace Project1
{
    public class Class1
    {

        private static void Main()
        {
            Console.WriteLine("Simple program attacked by avast");
            Thread.Sleep(7650);
        }

    }

}

So, my question is, why does this happen and what should I do to prevent this? Adding project directory to anti-virus exceptions or disabling it while developing doesn't go because every user will have to do it.

user
  • 1
  • 1
  • Does it complain the same way if you removed the Thread.Sleep call? or replaced it with `await Task.Delay()` – Tero Feb 15 '21 at 18:35
  • Does the same thing happen if your project / assembly has a different name? – Joe Sewell Feb 15 '21 at 18:36
  • 1
    it does happen because antivirus-software is not made with programmers in mind. and in my opinion, there's no way around either starting everything twice or just adding the exception. – Franz Gleichmann Feb 15 '21 at 18:36
  • Add an exception for the folder. After development, create an installer. After the program is installed, it won't issue the warnings. One of the easiest ways to create an installer in VS, is to use Build => Publish. – Tu deschizi eu inchid Feb 15 '21 at 19:04
  • It's an executable, and Avast thinks it's malware. Add it to the list of exceptions in Avast. I had the same issue, but not for every .exe file... go figure. – insane_developer Feb 15 '21 at 19:15
  • Ultimately, only Avast can tell you why it happens. It's their analysis that's broken. You can configure exceptions in your specific case, because it's just your machine that's at issue. See duplicates for that and more advice on dealing with AV false positives. – Peter Duniho Feb 15 '21 at 20:13
  • It seems like Avast WILL DEFINITELY check every unknown executable – user Feb 17 '21 at 13:55

0 Answers0