EXE file just built contains a TROJAN !
I cloned C# application on my PC on Windows 11.
When I build appliction in Debug mode, Visual Studio 2022 return this error !
Message in english: error when importing EXE file -- refused access
In same time Bitdefender display that a virus has been blocked
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 ?
It's false positive. Upgrade the project in place to .net8 and it's working fine
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
- I installed .Net8 on my PC.
- I installed .Net Upgrade Assistant extension on last build of Visual Version 2022
- I restarted Visual Studio 2022
- I started Upgrade from application contextual menu in solution explorer
- I selected In-Place projet upgrade
- 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.
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.
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?