我正在尝试将ConfuserEx版本1.6集成到MsBuild中。它应该自动混淆文件,但对我不起作用。我已经添加了Confuser.MsBuild v1.6Nuget包到项目中。
如果我错过了任何一步谁能帮我吗。
发布于 2022-09-16 18:19:27
在将Confuser.MsBuild nuget添加到项目之后,应该自动将以下行添加到*.csproj文件中:
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Confuser.MSBuild.1.6.0\build\Confuser.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Confuser.MSBuild.1.6.0\build\Confuser.MSBuild.targets'))" />
</Target>
<Import Project="..\packages\Confuser.MSBuild.1.6.0\build\Confuser.MSBuild.targets" Condition="Exists('..\packages\Confuser.MSBuild.1.6.0\build\Confuser.MSBuild.targets')" />
现在,您可以将模糊处理包含到构建过程中。这也是在*.csproj文件中完成的,只有极小的条目,如:
<PropertyGroup>
<Obfuscate>true</Obfuscate>
<ConfuserReplaceOutput>true</ConfuserReplaceOutput>
</PropertyGroup>
在此之前,请查看更多详细的信息和选项,查看ConfuserEx维基。
https://stackoverflow.com/questions/71759877
复制相似问题