Net4x.Xamarin.Forms.Build.Tasks 5.0.0.1

dotnet add package Net4x.Xamarin.Forms.Build.Tasks --version 5.0.0.1
                    
NuGet\Install-Package Net4x.Xamarin.Forms.Build.Tasks -Version 5.0.0.1
                    
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="Net4x.Xamarin.Forms.Build.Tasks" Version="5.0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.Xamarin.Forms.Build.Tasks" Version="5.0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.Xamarin.Forms.Build.Tasks" />
                    
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 Net4x.Xamarin.Forms.Build.Tasks --version 5.0.0.1
                    
#r "nuget: Net4x.Xamarin.Forms.Build.Tasks, 5.0.0.1"
                    
#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 Net4x.Xamarin.Forms.Build.Tasks@5.0.0.1
                    
#: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=Net4x.Xamarin.Forms.Build.Tasks&version=5.0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.Xamarin.Forms.Build.Tasks&version=5.0.0.1
                    
Install as a Cake Tool

Net4x.Xamarin.Forms.Build.Tasks

The build-time half of Xamarin.Forms XAML: MSBuild tasks and targets that generate the code-behind partial class and compile XAML into IL.

dotnet add package Net4x.Xamarin.Forms.Build.Tasks

This is an MSBuild task package, not a library — it ships no lib/ folder and adds no compile-time reference. Its build/ targets are imported automatically on install; nothing else is needed to wire it up.

What it does

Task Role
XamlGTask Generates the InitializeComponent() method and the x:Name backing fields as a partial class
CssGTask Same for CSS StyleSheet resources
XamlCTask Compiles XAML to IL at build time (Mono.Cecil), replacing runtime parsing
DebugXamlCTask Emits the debug-friendly variant; opt in via build\Xamarin.Forms.Debug.targets

XAML files are picked up automatically in SDK-style projects (**\*.xaml become EmbeddedResource, paired with their .xaml.cs). XAML problems are reported as MSBuild errors with source positions rather than runtime exceptions.

Whether a page is compiled or parsed at runtime is chosen per assembly or per type with [XamlCompilation(XamlCompilationOptions.Compile)], from Net4x.Xamarin.Forms.Xaml.

Properties

Property Effect
EnableDefaultXamlItems Set to False to stop globbing **\*.xaml (default True)
EnableDefaultCssItems Same for **\*.css (default True)
XFKeepXamlResources Keep the XAML as an embedded resource after compiling it
XFXamlCValidateOnly Validate the XAML without emitting compiled IL
XFDisableTargetsValidation Skip the duplicate-import and target-framework checks
_XFBuildTasksLocation Directory the task assembly is loaded from; defaults to the package's own build\<tfm>\

Importing the targets twice is reported as error XF001.

Package layout

build/
  Net4x.Xamarin.Forms.Build.Tasks.props     NuGet auto-import entry point
  Net4x.Xamarin.Forms.Build.Tasks.targets   NuGet auto-import entry point
  Xamarin.Forms.props / .targets            the actual logic
  Xamarin.Forms.DefaultItems.props/.targets XAML/CSS default globs
  Xamarin.Forms.Debug.targets               opt-in debug XAML compilation
  netstandard2.0/                           task assembly + Mono.Cecil + System.CodeDom

The entry points are thin forwarders: NuGet only auto-imports build/<PackageId>.props|.targets, while the files carrying the logic keep their historical Xamarin.Forms.* names so projects that import them directly keep working.

About this fork

Maintenance fork of the 5.0.0 branch of xamarin/Xamarin.Forms, published under the Net4x. package prefix. Upstream Xamarin.Forms reached end of support on May 1, 2024 and was succeeded by .NET MAUI; new applications should target .NET MAUI instead.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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
5.0.0.1 45 9/30/2026
5.0.0 111 8/4/2026