NoFences icon indicating copy to clipboard operation
NoFences copied to clipboard

EXE file just built contains a TROJAN !

Open schlebe opened this issue 11 months ago • 4 comments

I cloned C# application on my PC on Windows 11.

When I build appliction in Debug mode, Visual Studio 2022 return this error !

Image

Message in english: error when importing EXE file -- refused access

In same time Bitdefender display that a virus has been blocked

Image

Message in english: The EXE file is infected by TROJAN ...

When I build application in Release mode, all is working correctly !!!

What happens ?

Is there a virus in EXE file that I'm just building ?

schlebe avatar Feb 13 '25 15:02 schlebe

It's false positive. Upgrade the project in place to .net8 and it's working fine

mlnlck avatar Mar 13 '25 18:03 mlnlck

I have migrated to .Net8 and I continue to have same error in Debug mode. Release mode continue to work correctly.

To build application using .Net8, I have

  1. I installed .Net8 on my PC.
  2. I installed .Net Upgrade Assistant extension on last build of Visual Version 2022
  3. I restarted Visual Studio 2022
  4. I started Upgrade from application contextual menu in solution explorer
  5. I selected In-Place projet upgrade
  6. I selected .Net 8

PS: Windows Forms is active for this project PS: I read some namespace NoFences.Win32 but application is built using x64 parameter.

schlebe avatar Mar 15 '25 10:03 schlebe

Maybe Bitdefender is locking the file (or it's location), this is what happens if you choose to restore from quarantine you can not even delete/overwrite the file. Try to move the project in another directory and build there.

mlnlck avatar Mar 15 '25 11:03 mlnlck

Well, first off the repository does not contain a trojan, but I have seen these false positives before. It seems like most antivirus software does not like software you compile yourself.

Also, tThe Win32 package is only for interacting with WinApi, it is not restricted to 32-bit. Mabye you can try creating a Bitdefender rule for excluding the folder you try to build in?

Twometer avatar Mar 15 '25 11:03 Twometer