Mono.ApiTools.MSBuildTasks
0.6.0
dotnet add package Mono.ApiTools.MSBuildTasks --version 0.6.0
NuGet\Install-Package Mono.ApiTools.MSBuildTasks -Version 0.6.0
<PackageReference Include="Mono.ApiTools.MSBuildTasks" Version="0.6.0" />
<PackageVersion Include="Mono.ApiTools.MSBuildTasks" Version="0.6.0" />
<PackageReference Include="Mono.ApiTools.MSBuildTasks" />
paket add Mono.ApiTools.MSBuildTasks --version 0.6.0
#r "nuget: Mono.ApiTools.MSBuildTasks, 0.6.0"
#:package Mono.ApiTools.MSBuildTasks@0.6.0
#addin nuget:?package=Mono.ApiTools.MSBuildTasks&version=0.6.0
#tool nuget:?package=Mono.ApiTools.MSBuildTasks&version=0.6.0
Mono.ApiTools.MSBuildTasks
MSBuild tasks to help with adjusting .NET assemblies during a build.
โก Quick Start
dotnet add package Mono.ApiTools.MSBuildTasks
Then use the tasks in your MSBuild project files (.csproj, .targets, etc.).
Features
๐ GeneratePublicApiFiles
Generate PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files compatible with
Microsoft.CodeAnalysis.PublicApiAnalyzers
for tracking API surface changes. Supports nullable annotations, oblivious markers, and
[Experimental] attribute prefixes.
<GeneratePublicApiFiles
Assembly="$(OutputPath)YourLibrary.dll"
Files="@(PublicApiFiles)"
ReferenceSearchPaths="@(ReferencePath->'%(RootDir)%(Directory)')" />
| Property | Required | Description |
|---|---|---|
Assembly |
โ | The assembly to generate public API files from |
Files |
โ | The PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt file items |
ReferenceSearchPaths |
Directories to search for assembly dependencies |
๐งน RemoveObsoleteSymbols
Remove [Obsolete] types and members from assemblies โ useful for cleaning up reference assemblies.
<RemoveObsoleteSymbols
Assembly="$(OutputPath)YourAssembly.dll"
OnlyErrors="true"
OutputAssembly="$(OutputPath)YourAssembly.ref.dll" />
| Property | Required | Description |
|---|---|---|
Assembly |
โ | The assembly to scan |
OnlyErrors |
Only remove [Obsolete("...", true)] error members (default: true) |
|
OutputAssembly |
Output path; defaults to modifying the input assembly in place |
๐ง AdjustReferencedAssemblyVersion
Update an assembly reference version to match the actual referenced assembly โ useful for strong-named assemblies that need version alignment.
<AdjustReferencedAssemblyVersion
Assembly="$(OutputPath)YourAssembly.dll"
ReferencedAssembly="$(OutputPath)Dependency.dll" />
| Property | Required | Description |
|---|---|---|
Assembly |
โ | The assembly to modify |
ReferencedAssembly |
โ | The reference assembly providing the correct version |
OutputAssembly |
Output path; defaults to modifying the input assembly in place |
๐ ReplaceReferencedAssembly
Replace one assembly reference with another entirely โ name, version, public key token and all.
<ReplaceReferencedAssembly
Assembly="$(OutputPath)YourAssembly.dll"
ReferencedAssemblyName="OldDependency"
NewReference="$(OutputPath)NewDependency.dll" />
| Property | Required | Description |
|---|---|---|
Assembly |
โ | The assembly to modify |
ReferencedAssemblyName |
โ | Name of the existing reference to replace |
NewReference |
โ | The new reference assembly |
OutputAssembly |
Output path; defaults to modifying the input assembly in place |
Common Use Cases
- API surface management โ Generate and maintain PublicAPI files for library versioning
- Reference assemblies โ Remove obsolete symbols from contract assemblies
- Strong-named assemblies โ Align reference versions without recompiling
- Assembly binding โ Redirect references to different assembly implementations
๐ GitHub Repository ยท MIT License
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on Mono.ApiTools.MSBuildTasks:
| Repository | Stars |
|---|---|
|
dotnet/maui
.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
|
|
|
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
|
|
|
dotnet/android-libraries
.NET for Android bindings for Google's libraries, such as AndroidX, GooglePlayServices, Firebase, and MLKit and their 3rd party dependency libraries.
|