Ok, it seems I have found a solution.
First of all, I modified the App.config file as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
Then I included a file NLog.config as follows:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="file" xsi:type="File"
fileName="${specialfolder:folder=ApplicationData}\\AppName\\Logs\\log.txt"
archiveEvery="Day"
archiveNumbering="Rolling"
maxArchiveFiles="30"
layout="${date:format=yyyy-MM-dd HH\:mm\:ss} ${level:uppercase=true} ${logger} - ${message} ${exception:format=tostring}"/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file"/>
</rules>
</nlog>
I also specified to include in the setup the file adxloader64.dll, though the compiler would give me a warning saying that the resource was not compatible with the type of setup specified: x86.
Note: I'm building a setup using Add-in Express 7.4.x
Now there is just one point to clarify: I should check if this setup works also on a 32-bit Windows system (I have to test it on a Windows 7 home)