Skip to main content
Version: 2023.3

11.1.  How to Exclude a Specific Assembly From Distribution

11.1.1. Overview

Once activated, assembly embedding and merging features change the set of assemblies that should be distributed with the obfuscated app. This change requires excluding the affected assemblies from the distribution. Eazfuscator.NET does most of this work automatically. However, in some cases, you may need to put extra effort into excluding the specific assemblies from being distributed.

11.1.2. NuGet Package

If you want to exclude a specific reference assembly from being distributed as a part of the NuGet package, you should mark the corresponding package or project references with PrivateAssets=all attribute as shown below:

Example 11.1. MSBuild project file

<Project>

<ItemGroup>

<!-- The assembly may come from a referenced NuGet package -->
<PackageReference Include="Contoso.Framework.DataAccess" Version="4.7.5" PrivateAssets="all"/>

<!-- or from a project -->
<ProjectReference Include="..\Contoso.QuickRun.Engine.Dal.csproj" PrivateAssets="all"/>

</ItemGroup>

</Project>

11.1.3. Setup

If you want to exclude a specific assembly from being distributed as a part of the product setup, you should consult the documentation of the setup authoring tool you use.