我能够在运行Visual Studio解决方案时对.dll进行模糊处理。
问题是,我不知道在将应用程序发布到. exe中时如何做到这一点。因为仍然可以使用反混淆器看到已发布的exe中的dll的源代码。谁能帮我个忙?先谢谢了。
lztngnrs1#
我刚刚找到了解决方案。通过安装Obfuscar Global Tool并将以下代码添加到我的.csproj文件中。
<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>
<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>
这允许我在发布时更改dll文件。谢谢大家帮我解决这个问题,我真的很感激!
1条答案
按热度按时间lztngnrs1#
我刚刚找到了解决方案。通过安装Obfuscar Global Tool并将以下代码添加到我的.csproj文件中。
这允许我在发布时更改dll文件。
谢谢大家帮我解决这个问题,我真的很感激!