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, 2022 at 20:08
  • csoonline.com/article/3216765/…
    – nobody
    Mar 25, 2022 at 0:05
  • 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, 2022 at 0:24
  • 1
    @Polynomial . For C# its just Console.WriteLine("Hello World"); For C++ its #include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; }
    – Furkan125
    Mar 25, 2022 at 21:22
  • 2
    Thank you everyone for help. Building my program in Release fixed my problem.
    – Furkan125
    Mar 25, 2022 at 21:36


You must log in to answer this question.

Browse other questions tagged .