Absence.Fody 1.0.5

dotnet add package Absence.Fody --version 1.0.5
NuGet\Install-Package Absence.Fody -Version 1.0.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="Absence.Fody" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Absence.Fody --version 1.0.5
#r "nuget: Absence.Fody, 1.0.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.
// Install Absence.Fody as a Cake Addin
#addin nuget:?package=Absence.Fody&version=1.0.5

// Install Absence.Fody as a Cake Tool
#tool nuget:?package=Absence.Fody&version=1.0.5

Absence.Fody

NuGet package License

This is an add-in for Fody which lets you trim unused private/internal types during compile-time.

This project has a dependency to Emik.Morsels, if you are building this project, refer to its README first.



Installation

  • Install the NuGet packages Fody and Absence.Fody. Installing Fody explicitly is needed to enable weaving.

    PM> Install-Package Fody
    PM> Install-Package Absence.Fody
    
  • Add the PrivateAssets="all" metadata attribute to the <PackageReference /> items of Fody and Absence.Fody in your project file, so they won't be listed as dependencies.

  • If you already have a FodyWeavers.xml file in the root directory of your project, add the <Absence /> tag there. This file will be created on the first build if it doesn't exist:

<Weavers>
    <Absence />
</Weavers>

See Fody usage for general guidelines, and Fody Configuration for additional options.

Configuration

You can add an Except attribute to exclude namespaces or types separated by any amount of whitespace:

<Weavers>
    <Absence Exclude="Foo DoNotExcludeMe
                      Do.Not.Exclude.Me" />
</Weavers>

Types may either be fully qualified, or not at all. Partially qualified names are not supported due to potential ambiguity.

Example

What you write:

public class Public 
{
    public class NestedPublic { }
    
    [ImplicitlyUsed]
    class NestedPrivateWithAttribute { }
    
    class NestedPrivate { }
}

[ImplicitlyUsed]
class InternalWithAttribute
{
    public class NestedPublic { }
    
    [ImplicitlyUsed]
    class NestedPrivateWithAttribute { }
    
    class NestedPrivate { }
}

class Internal 
{
    public class NestedPublic { }
    
    [ImplicitlyUsed]
    class NestedPrivateWithAttribute { }
    
    class NestedPrivate { }
}

What gets compiled:

public class Public 
{
    public class NestedPublic { }
    
    [ImplicitlyUsed]
    class NestedPrivateWithAttribute { }
}

[ImplicitlyUsed]
class InternalWithAttribute
{
    public class NestedPublic { }
    
    [ImplicitlyUsed]
    class NestedPrivateWithAttribute { }
}

Contribute

Issues and pull requests are welcome to help this repository be the best it can be.

License

This repository falls under the MPL-2 license.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETFramework 1.0

  • .NETStandard 1.0

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
1.0.5 366 1/15/2023
1.0.4 243 1/14/2023
1.0.3.3 259 1/14/2023
1.0.3.2 254 1/14/2023
1.0.3.1 248 1/14/2023
1.0.3 252 1/14/2023
1.0.2 247 1/13/2023
1.0.1 253 1/11/2023
1.0.0 259 1/9/2023