SmartAssembly 8

Process assemblies inside a NuGet package

SmartAssembly MSBuild task can be used to protect assemblies inside a NuGet package.

  1. Open your .NET Standard project in Visual Studio.
  2. Build it in Release mode.
  3. Add reference to RedGate.SmartAssembly.MSBuild NuGet package.
  4. Open SmartAssembly and:
    • Choose assembly from Release folder as main assembly.
    • Choose any location for destination assembly.
    • Save the project next to .csproj with the same name.
  5. Edit your .csproj and add a new property:

    <PropertyGroup>
      ...	
      <SmartAssemblyOverwriteAssembly>true</SmartAssemblyOverwriteAssembly>
    </PropertyGroup>
  6. Use dotnet pack -c Release command-line command to create a NuGet package from your .NET Standard project (or use Publish/Pack option in Visual Studio).
  7. The created .nupkg file will contain an obfuscated version of your assembly.

Didn't find what you were looking for?