Showing results for 
Show  only  | Search instead for 
Did you mean: 

C# Files Denied Access


There is now an issue with C# files that I create that Mcafee is blocking! I am an aspiring Software Engineer and this draw-back is forcing me to use Online IDES to run my scripts which is not ideal.

Here is one code that is blocked:

using System;

namespace CheckArrayNumber
public class CheckN
public static void Main(String [] args)
//instantiate the array object first
int[] myNum = {10, 20, 30, 40};
//call the method, then call the instantiate array. Pass the variable.
public static bool Check(int[] arr, int el)
foreach(int item in arr)
if(item == el)
return true;
return false;

As you can see, this is a totally harmless code. It keeps getting a virus signature each time I attempt to run the .exe with the CLI(Command Line Interface). Just 4 months ago I was able to compile C# files fine but now I am getting False Positives for viruses for scripts ran through the command line.

How do I make an exception that I can run scripts through the CLI?

5 Replies
Report Inappropriate Content
Message 2 of 6

Re: C# Files Denied Access

Hi @PocketPixie 

Please try excluding the .exe file in firewall exceptions and check the outcome. Also let us know the McAfee version installed on the device. 


Magesh J

Re: C# Files Denied Access

Hello Magesh,

The problem with excluding the .exe means excluding every single .exe that I create. This can be problematic as I have multiple files that I want to run through the CLI.

Is there a way to exclude a folder in the firewall settings or the C# language? I had a McAfee agent working remotely on this but they just added all the files (including .cs ones) and disconnected with my firewall and real-time scanning off. I had to manually turn them back on.

When I had McAfee back in late 2019 this wasn't an issue before. Also here is a picture of what i've been getting.


False FlagFalse Flag

McAfee assumes that any C# .exe file I run through the CLI is a virus called Real Protect LS! This defiantly needs to be submitted to McAfee developers, as running a C# file without an IDE should not be an issue.

Re: C# Files Denied Access

I just had my virus scan today and the scanner yanked out the files that I had.



More false positives.

Re: C# Files Denied Access

Is anyone going to respond to this?


I'm a software dev and these false flags happen when I try to execute .exe from the cmd line. It blocks every single C# application that I create this way which is not ideal for someone developing software. I'm forced to use VS2019 to develop my software for snippets that don't need the extra bundling that comes from IDE.

McAfee, please look into this and take the false positives out of future updates to the software. I've submitted an issue to tech support and never got a follow-up back on a solution. I have chatted with supported and their only 'solution' was to individually mark each and every single file by the virus scanner. Not only is this tedious but the scanner will just yank the .exe files again once it finds them in quarantine.


I can tell McAfee is just auto-blocking .exe files being executed and not the content of those files.

Re: C# Files Denied Access

If you developed the software involved follow this FAQ to get it whitelisted

McAfee KB - How to submit your company's software to be considered for whitelisting (TS102751)

If not submit the files as per

How to submit virus samples and false positives to McAfee

How Many Badges Can You Collect?
Ready for a little competition? Members like you are earning badges and unlocking perks for their helpful answers. Are you? Click here to find out.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community