Is there code I can include in my CSharp project file to check if ConfuserEx executed properly, and kill the compile process if not? Maybe use reflection to check if a class name still exists (i.e. has not been obfuscated)?
Update: This is the code in the .csproj
file that calls the obfuscation routine:
<Target Name="AfterCompile">
<Exec Command="if "$(PlatformName)" == "AnyCPU" (if "$(ConfigurationName)" == "Release" (powershell.exe -ExecutionPolicy Bypass -File "$(ProjectDir)confuserEx\confuserps.ps1" "'C:\Program Files\ConfuserEx\Confuser.CLI.exe'" "'$(ProjectDir)confuserEx\confuser.crproj'" "'$(ProjectDir)obj\$(ConfigurationName)\'" "'$(ProjectDir)obj\$(ConfigurationName)\$(TargetFileName)'" "'normal'" )
) else (if "$(ConfigurationName)" == "Release" (powershell.exe -ExecutionPolicy Bypass -File "$(ProjectDir)confuserEx\confuserps.ps1" "'C:\Program Files\ConfuserEx\Confuser.CLI.exe'" "'$(ProjectDir)confuserEx\confuser.crproj'" "'$(ProjectDir)obj\$(PlatformName)\$(ConfigurationName)\'" "'$(ProjectDir)obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName)'" "'normal'" )
)" />
</Target>