SmartAssembly MSBuild task allows you to protect your assembly automatically during build. Refer to documentation to learn more: https://documentation.red-gate.com/sa8/building-your-assembly/using-smartassembly-with-msbuild Installed and activated version of SmartAssembly is required to run this task.
$ dotnet add package RedGate.SmartAssembly.MSBuildNo README available.