AssemblyAttributeRemover 0.1.5

dotnet add package AssemblyAttributeRemover --version 0.1.5
                    
NuGet\Install-Package AssemblyAttributeRemover -Version 0.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AssemblyAttributeRemover" Version="0.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AssemblyAttributeRemover" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="AssemblyAttributeRemover" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AssemblyAttributeRemover --version 0.1.5
                    
#r "nuget: AssemblyAttributeRemover, 0.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AssemblyAttributeRemover@0.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AssemblyAttributeRemover&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=AssemblyAttributeRemover&version=0.1.5
                    
Install as a Cake Tool

AssemblyAttributeRemover

This nuget package automatically removes unwanted attributes from assemblies in your bin folder upon build.

Motivation

For example, another nuget package might install a DLL with unwanted attributes. Instead of all the tedious steps of patching the DLL manually, creating a fork of the old nuget package, and maintaining it forever, just use this nuget package.

Configuration

By itself, adding the nuget package does nothing. You configure its actions in your .csproj file, specifying which attributes should be removed from which assemblies. By using normal MsBuild conditions, you can fine-grain the scenario as much as you like.

Example

<Project Sdk="Microsoft.NET.Sdk">
...
  <ItemGroup>
    <PackageReference Include="AssemblyAttributeRemover" Version="1.0.0" />
    <AssemblyAttributeRemover
      Condition=" '$(TargetFramework)' == 'net472' "
      Include="System.Data.SQLite.EF6,System.Security.AllowPartiallyTrustedCallersAttribute" />
  </ItemGroup>
...
</Project>

Adding these lines to a .csproj file will have the following effect:

Upon build of .NET Framework 4.7.2, will look inside the bin folder for a DLL called System.Data.SQLite.EF6.dll, and - if found - will remove all attributes of type AllowPartiallyTrustedCallersAttribute from it, resaving the DLL in-place.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETFramework 4.7.2

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.5 198 9/8/2025