I wrote this app years ago, for my own personal use, never published it anywhere.
I wondered if a virus might have been able to infect it, but even restoring the exe from six years ago doesn't solve the problem.
I haven't managed to find anything useful on how this trojan is detected, which might enable me to change whatever it is in my code that provokes this.
(I'm also not sure whether this is the right place to ask the question)
Get a second opinion by scanning it with other engines, such as with VirusTotal.
Upload it for analysis by Microsoft security intelligence. Microsoft has an interest in keeping you both as a developer and Windows user.
This specific variant was cataloged by Microsoft in January 2021. AgentTesla is a remote access trojan that has evolved, so unfortunately it seems your thing got flagged as a false positive in a recent detection update.