49

I've been practicing my C# lately on a new system. Compiling is fine, however when I try to run the generated .exe file, avast! thinks it is malware and runs it in the sandbox for a while (and it doesn't work in the sandbox as it should work normally), and only when it has finished scanning it will it let me run it normally.

When I try to run it again, most of the time the same process happens, whether I make changes to the code or not.

Is there any way I could play around with Avast's settings to stop it attacking my programs?

Note: I'm dealing with very simple, command prompt programs here.

migrated from stackoverflow.com Feb 22 '13 at 18:11

This question came from our site for professional and enthusiast programmers.

  • 6
    have you tried setting an exclusion folder for your root code folder? – DiskJunky Feb 22 '13 at 17:34
  • I have never, ever dealt with a problem like this. Either your EXE is doing something strange, or you need to dump this Avast app. That said, looks like you're not the only person why may have encountered this. I found several related links using [this Google search](google.com/…. – Jonathan Wood Feb 22 '13 at 17:35
  • Weird. I run Avast and I'm a .NET developer for a living as well as doing a great deal of development at home in my spare time. I've never had Avast complain about one of my apps. – Pete Feb 22 '13 at 17:57
  • Disable Avast from scanning the directory where your .exe file is located. The fact your .exe is being blocked by Avast means your doing something nasty or odd enough Avast is flagging it. A normal program would not do this. – Ramhound Feb 22 '13 at 18:43
  • 5
    The comments here are terrible. Pointing fingers at OP instead of simply helping, or "it works for me!". The very idea that the program is only being scanned because "it's doing something dodgy" is crazy -- how does Avast know if it's doing something dodgy if it hasn't scanned it yet? :) Personally I get this all the time on a wide variety of programs I've compiled myself for whatever reason.e.g. SumatraPDF I suspect it's because these files are signed or 'installed' in any way. – Pod Nov 14 '16 at 9:23

10 Answers 10

22

According to a user manual that I was able to find for version 4.8(see page 40), You need to do as the comments suggest and add your obj directory or bin directory to the exclusions list.

According to a post I found in the Avast forums from 2011 you can also add exclusions for single files by:

...manually edit[ing] the line where the path for the exception is. So, using the "browse" button, select first the folder, and then edit the resulting path and "add" to exclusions. You can also use "*" and "?".

27

You have to disable Avast DeepScreen:

Open Avast user interface>Settings>Antivirus uncheck, Enable DeepScreen.

enter image description here

It is now a much smaller option on the same page, (6th one down)

The option is harder to find (in my opinion) for the different version I have (version in the image).

enter image description here

In Avast Premier 2017, disabling Hardened Mode does nothing! Instead you have to disable CyberCapture as shown below:

enter image description here

  • 7
    This is the only thing that worked for me, exclusions didn't help. I'm very frustrated that I had to turn off part of my antivirus because it decided to forever block programs I use daily even after a clean scan. – Ben Nov 26 '13 at 4:52
  • 3
    This didn't work for me! Disabling DeepScreen had nothing but the same effects I was seeing before. – jj_ Apr 25 '15 at 4:43
  • This does not work – user55570 Apr 28 '18 at 23:47
7

As others have mentioned, the culprit is DeepScreen. It's especially bad if you have Avast set to Silent/gaming mode because then you can get unexpected/bizarre behavior and have no idea why. (I spent an entire day debugging the installer for a program I'm developing because it suddenly started running twice every single time I launched it--DeepScreen is very forgetful--and only succeeding on the the second run.)

Going under Settings, Update, Details, you can turn off popups for the majority of them--the annoying update-related popups, which should make it easier to work undisturbed, play video games, etc. But DeepScreen popups still pop up!

CANNOT DISABLE DEEPSCREEN: I've tried disabling DeepScreen entirely (under Settings, Antivirus), since it's so disruptive, but this checkbox appears to have no effect.

Unfortunately, the only way I currently have of disabling DeepScreen (in Avast 2014.9.0.2021) is to disable all shields! And I'm not even sure that this is working, since I sometimes get DeepScreen popups even with all shields disabled. Avast can't be prevented from starting with Windows during boot, so maybe uninstalling Avast is the only solution.

  • 1
    didn't work for me, disabling DeepScreen changed nothing. – jj_ Apr 25 '15 at 4:44
  • 1
    It didn't work for me either (see "no effect" above), but temporarily disabling Avast (for testing purposes) usually did. If I were testing it today, though, I'd try the exclusion-list solution first, (see Pow-lan's answer). – Jon Coombs Apr 26 '15 at 7:02
  • Of course I had tried all exclusion lists before (both live monitoring and manual scan)... – jj_ Apr 27 '15 at 13:12
2

As you are using Avast double click on the Orange Avast Orb. Select Settings, and then select Antivirus. Scrolling down the Screen you will see Exclusions.

If you select Exclusions and the directory you are compiling to. you will be able to compile from any directory you exclude. Without any troubles.

  • This does not work – user55570 Apr 28 '18 at 23:46
1

If none of these worked as they didn't for me try this.

Open Avast > Settings > Components > Files System Shield > Customize > Exclusions > Add the path > OK > OK and you're done.

  • Also does not work – user55570 Apr 28 '18 at 23:46
1

I Added a file path exclusion for my entire dev folder d:\dev\* and this worked using Avast Professional 2017:

  1. Right-click Avast icon in the system tray
  2. Select Open Avast user Interface
  3. Click Settings at the bottom left of the window
  4. In the General tab scroll down to the Exclusions entry
  5. Enter a folder name in the File paths tab e.g. d:\dev\* (Every file and sub folder of the dev folder will be ignored)
  6. Click ok, bottom right and the changes will be applied immediately

I didn't change Enable Cyber Capture or any other setting

  • This does not work – user55570 Apr 28 '18 at 23:46
  • Hi @user55570 are you sure you're using the correct path to your exe files ? I've since changed my antivirus program. Perhaps this doesn't work on the the latest version. – PhilG May 3 '18 at 7:02
0

I have tried all of the other solutions, like adding an exclusion or deep screen exclusion or exclusion to File System Component shield or disabling deepscreen, etc. The only solution that works for me is to stop the Avast service in services.msc or Computer Management/Services.

0

I create D:\ProjectDir then put source code or solution under this directory.

Open Avast > Settings > Exclusions > File paths and add D:\ProjectDir\*\bin\*\*

this is safer than adding rule D:\ProjectDir\* because avast will scan source code for example in D:\ProjectDir\myapp\ but not compiled app located at

D:\ProjectDir\myapp\bin\Debug\myapp.exe
D:\ProjectDir\myapp\bin\Release\myapp.exe

With new avast (2018) Exclusions is enough you don't need to disable DeepScreen

if still not work your app is truly Virus you need to disable or uninstall Avast :lol:

-1

Here is an addition to @PhilG 's answer:

Go into Avast general settings (example of a working avast settings).

In the picture above you can see Exclusions. Add a new file path under File paths tab.

If you want to only exclude an .exe file, add its path under CyberCapture tab.

  • This does not work – user55570 Apr 28 '18 at 23:42
  • All the checkboxes are set-up as in the picture? Did you also try to exclude only 1 exe file using the CyberCapture tab? – Patronaut May 2 '18 at 13:28
  • yes. I added both wildcard and the specific .exe file. And the checkboxes are the same as in picture. – user55570 May 3 '18 at 21:59
-1

Done all the things above (including scanning/excluding the directory/exec where the exec is located) but 20 second after starting, avast kill it. No message, no quarantine, but i have found a way to circumvent the problem:

  1. stop all avast agents
  2. start the exec.
  3. reactivate all agents.

everything is ok until next boot.

But if i can't find any valuable solution, i'll kill avast definitly !

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.