I just found the solution. By installing Obfuscar Global Tool and adding the following code to my .csproj file.
<Target Name="Obfuscation" AfterTargets="AfterCompile">
<Message Text="Obfuscating" Importance="high" />
<!--Optional to log a message.-->
<Exec Command="obfuscar.console obfuscar.xml" />
<!--Assuming you have installed Obfuscar.GlobalTool(attpsifluww.nuget.org/packages/Obfuscar.GlobalTool). -->
<Exec Command="COPY $(ProjectDir)$(IntermediateOutputPath)Protected\$(TargetFileName) $(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)" />
</Target>
This allowed me to change the dll file on publish.
Thanks everyone for helping me solve this. I really appreciate it!