53

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.

slhck
  • 235,242
Bluefire
  • 685

10 Answers10

28

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

Xonatron
  • 1,272
  • 6
  • 16
  • 23
23

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 "?".

Pow-Ian
  • 425
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.

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.

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.

M Seck
  • 9
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

PhilG
  • 11
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.

user55570
  • 820
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:

ewwink
  • 101
-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.

Toto
  • 19,304
Patronaut
  • 101
-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 !

Toto
  • 19,304