I just wrote and compiled a Hello World program in C# (I'm using Visual Studio 2022) and when I sent the file to VirusTotal, 1 antivirus program detected the exe as unsafe (VirusTotal results of C# Hello World Program). When I rewrote the same program in C++ and sent it to VirusTotal, 4 antivirus programs detected viruses ([VirusTotal results of C++ Hello World Program). Does this indicate that the programs are indeed viruses or is it just a false positive? Also, how can I make that the program is not detected as a virus?

  • 2
    These are behavioural heuristic detections. You need to post the source code (e.g. on GitHub or Pastebin) for us to have any idea of why this was detected.
    – Polynomial
    Mar 24 at 20:08
  • @Polynomial Presumably the program source code is just VS boilerplate and "Console.WriteLine("Hello World!");"
    – hft
    Mar 25 at 0:23
  • 1
    Maybe it's getting detected because it is compiled in debug mode and that triggers some AV heuristics... Anyways, it is quite hard to say since we don't know which AVs detected it, or why, or what the actual program looks like.
    – hft
    Mar 25 at 0:24
  • 2
    Thank you everyone for help. Building my program in Release fixed my problem.
    – Furkan125
    Mar 25 at 21:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.