6

I made some changes in my code and when I went to debug my program I got a build error. The error prompted my anti-virus software (Avast) to block my program as a "suspicious file".

Visual Studio returned this error: Error 1 Could not copy the file "obj\Debug\CopyFile.exe" because it was not found.

Here is a run down of the events that occurred before this error began to happen.

  1. Added new menu item to menu strip.

  2. Replaced instances of radio button references in the code with the new menu items.

  3. Ran a debug, program worked fine, until I clicked a button.

  4. Found the remaining instances of radio button references in the code and replaced them.

  5. Ran a debug, program was working fine. Exited debug.

  6. Deleted the old radio buttons from the GUI. (They no longer had any references in the code.)

  7. Tried to debug, received an error, antivirus software blocks program exe file as suspicious.

  8. Error Could not copy the file "obj\Debug\CopyFile.exe" because it was not found.

What did I do to the code to cause this? Did I possibly delete some other area of the code on accident and I do not know? I can't see why my program won't debug.

user2348797
  • 373
  • 4
  • 9
  • 22
  • I ran into this issue with Avast. Suddenly, it started deleting my exe from obj\Debug folder and breaking my build. I added the exclusion and that fixed everything. – svarcoe Oct 04 '13 at 18:36

1 Answers1

4

Why don't you simply tell to your antivirus software to do its business in some other places than your working directory? ( Exclude Paths ) and ignore every action done by Visual Studio executables ?

By the way, this is one of the first things to do to get better performance when working with a complex IDE like VS that can create, move, delete thousands of files when working.

If I remember well, the AVAST has its exclusion list in File System Shield, Expert Settings, Exclusions

Steve
  • 213,761
  • 22
  • 232
  • 286
  • I disabled the antivirus and restored the file that the antivirus had put in the vault. It is running fine now. But is this type of thing common? Random antivirus interference? It was working fine for a long time and then suddenly and randomly my program is flagged as suspicious when I debug. – user2348797 May 07 '13 at 08:08
  • 1
    No it is not common that an antivirus decides that your program is a virus (unless you write a virus of course :-))) However disabling the realtime scan on your working dev path is a must. – Steve May 07 '13 at 08:14
  • But this is why ask the question and why i'm worried (and confused) the only change I made was to switch from using a radio button to a menu item. It was at that time the antivirus blocked my program on debug. That was the first time it happened. Should I be worried? – user2348797 May 07 '13 at 08:21
  • 1
    NO, why you should be worried? It is just one program that has been changed and now some of its bytes accidentally resembles a virus signature. – Steve May 07 '13 at 08:32
  • Okay, thank you! This was great help and I can get back to working on my program :) – user2348797 May 07 '13 at 08:36