Search code examples
c#virusmediafirewindows-defender

Can't download my own executeable c#


I just made a small and simple windows form. I uploaded the .exe to mediafire so anyone could download it, but when someone(or even myself) tries to download it: windows defender instantly deletes it, because it thinks it is a virus. Is this a problem with the code or does it has to do with something else?


Solution

  • Hash it to check it was not modified

    Check with some digest algorithm like SHA-2 that the file you download from the site is actually the exact same that you uploaded.

    If it is not the same, something fishy has happened to your file when on a trip to the internet. I wouldn't try to open it, and try to find another service to host your file.

    Sign your executable with a certificate

    Invest in some code signing certificate.

    Some are free, and for beginning and test pourposes you can create it yourself and self-sign it, but it will still be frowned upon by anti-malwares and your system.

    Other comments

    Also, some code operations are considered "dangerous" by some antivirus, because theese operations are much more oftne found in exploits attempts than in real commercial code. I remember, when I was playing with simple console C++ code while learning, I did some unsafe operation with a simple string char[]. On my school computer, the result executable was automatically deleted with the McAfee guard within seconds of compilation...