Add as a Post Build Event to Visual Studio Project. Make sure you create the configuration file by opening Dotfuscator, configuring all your settings, and then saving the configuration as Dotfuscator1.xml in the root folder of your project.

 
POST BUILD EVENT WITH STATIC PATHS
(this was the only way I could get it to work right now)
 
if $(ConfigurationName)==Release (
echo RELEASE - Obfuscate.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscatorCLI.exe" /v /p=SourceDir=C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir),SourceFile=$(TargetFileName) C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\Dotfuscator1.xml
copy C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\Dotfuscated\$(TargetFileName) C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)$(TargetFileName)
echo Copy to "C:\LTKReleaseBuilds" directory
mkdir C:\LTKReleaseBuilds\
copy C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\Dotfuscated\$(TargetFileName) C:\LTKReleaseBuilds\$(TargetFileName)
rmdir C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\Dotfuscated
) ELSE (
echo DEBUG - No Obfuscation
)
  
echo Remove All Extra DLLs
ren C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)$(TargetFileName) TARGETDLL.txt
del C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)*.dll
del C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)*.pdb
del C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)*.xml
ren C:\onedrive\Projects\LTK\QCAudit\QCAuditScreen\$(OutDir)TARGETDLL.txt $(TargetFileName)


POST BUILD EVENT WITH DYNAMIC PATHS
(I was unable to get this to work because there is a comma in the name of my OneDrive folder)
  
if $(ConfigurationName)==Release (
echo RELEASE - Obfuscate.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscatorCLI.exe" /v /p=SourceDir=$(TargetDir),SourceFile=$(TargetFileName) $(ProjectDir)Dotfuscator1.xml
mkdir $(TargetDir)Dotfuscated\
copy $(TargetDir)Dotfuscated\$(TargetFileName) $(TargetDir)$(TargetFileName)
echo Copy to "C:\LTKReleaseBuilds" directory
mkdir C:\LTKReleaseBuilds\
copy $(TargetDir)Dotfuscated\$(TargetFileName) C:\LTKReleaseBuilds\$(TargetFileName)
rmdir /S /Q $(TargetDir)Dotfuscated
) ELSE (
echo DEBUG - No Obfuscation
)
 
// DYNAMIC - REMOVE EXTRA FILES
echo Remove All Extra DLLs
ren $(TargetDir)$(TargetFileName) TARGETDLL.txt
del $(TargetDir)*.dll
del $(TargetDir)*.pdb
del $(TargetDir)*.xml
ren $(TargetDir)TARGETDLL.txt $(TargetFileName)

Insert the code as a post build event in the Properties->Build Events section of your project: