Visual Studio 2022 & C# Generates Gen:Variant.MSILHeracles.46462 Virus

Bob Wentzel 6 Reputation points
2022-11-10T15:39:18.357+00:00

I am just now learning C# in VS 2022 and when running the simple program shown below Bitdefender detected and quarantined what it considers a virus and generated the message shown below. I suspect this is a false-positive, but I wanted to post this here just in case it isn't. Previous program examples ran without issue.

I am looking for recommendations and or mitigation actions. I am also going to post this on the Bitdefender forum.

Thanks.

CODE FOLLOWS
Console.Title = "Arrays";

// Declare variables
string[] Cars = new string[3] { "BMW", "Ford", "Opel" };
int[,] Coords = new int[2, 3] { { 1, 2, 3 }, { 4, 5, 6 } };

// Use arrays
Console.WriteLine("Second Car: " + Cars1);
Console.WriteLine("X1,Y1: " + Coords[0, 0]);
Console.WriteLine("X2, Y3: " + Coords[1, 2]);
Console.ReadLine();

259162-infected-file-detected.jpg

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,253 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,031 Reputation points
    2022-11-18T22:59:45.057+00:00

    there are two options.

    1. Your computer is really infected
    2. Your generated code look enough like the virus code to get tagged (common issue). You can try changing your code to see if the false flag goes away.

    note: if this is a published app, you can file with virus scanner software to create an exception.

    0 comments No comments

  2. azurabennett 0 Reputation points
    2023-10-08T13:50:41.33+00:00

    Sure, to quickly resolve the issue of Bitdefender flagging your C# code as a virus, start by whitelisting your project folder in Bitdefender's settings under the "Exclusions" tab. Update both Bitdefender and Visual Studio 2022 to the latest versions. Next, close Visual Studio, delete the bin and obj folders in your project directory, and recompile your code. Run the program as an administrator and double-check your compiler settings for any anomalies. For added assurance, run a secondary antivirus scan using software like Malwarebytes. If the issue persists, consider restarting your computer, keeping an eye on the Bitdefender forum for updates, and contacting Bitdefender support as a last resort. Reinstalling the .NET runtime could also be a final step if all else fails.

    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more