Nukepayload2.UI.VBWinUI3.XamlCompiler 3.0.0-dev

This is a prerelease version of Nukepayload2.UI.VBWinUI3.XamlCompiler.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Nukepayload2.UI.VBWinUI3.XamlCompiler --version 3.0.0-dev
                    
NuGet\Install-Package Nukepayload2.UI.VBWinUI3.XamlCompiler -Version 3.0.0-dev
                    
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="Nukepayload2.UI.VBWinUI3.XamlCompiler" Version="3.0.0-dev">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nukepayload2.UI.VBWinUI3.XamlCompiler" Version="3.0.0-dev" />
                    
Directory.Packages.props
<PackageReference Include="Nukepayload2.UI.VBWinUI3.XamlCompiler">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 Nukepayload2.UI.VBWinUI3.XamlCompiler --version 3.0.0-dev
                    
#r "nuget: Nukepayload2.UI.VBWinUI3.XamlCompiler, 3.0.0-dev"
                    
#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 Nukepayload2.UI.VBWinUI3.XamlCompiler@3.0.0-dev
                    
#: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=Nukepayload2.UI.VBWinUI3.XamlCompiler&version=3.0.0-dev&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Nukepayload2.UI.VBWinUI3.XamlCompiler&version=3.0.0-dev&prerelease
                    
Install as a Cake Tool

Nukepayload2.UI.VBWinUI3.XamlCompiler

A compiler-only replacement for the XAML compiler binaries that ship inside Microsoft.WindowsAppSDK.WinUI. Built from winui3-vbxamlc, a fork of microsoft-ui-xaml whose Visual Basic code generators are fixed: with DISABLE_XAML_GENERATED_MAIN defined they emit XamlGeneratedProgram.XamlGeneratedMain() plus the two-layer XamlGeneratedCreateApplicationInstance hooks that the stock compiler does not produce for VB.

The package contains only the compiler binaries. The MSBuild targets, genxbf and the reference assemblies keep coming from Microsoft.WindowsAppSDK; three properties are redirected:

Property Redirected to
XamlCompilerTaskPath tools\net472\Microsoft.UI.Xaml.Markup.Compiler.dll (desktop MSBuild) / tools\net8.0\… (Core MSBuild)
XamlCompilerJsonTaskPath tools\net472\Microsoft.UI.Xaml.Markup.Compiler.IO.dll (desktop) / tools\net8.0\… (Core)
XamlCompilerExePath tools\net472\XamlCompiler.exe

NuGet imports the props through obj\<project>.nuget.g.props, which is evaluated before the empty-value guards in the stock Microsoft.UI.Xaml.Markup.Compiler.interop.targets, so these assignments win.

Usage

<ItemGroup>
  <PackageReference Include="Nukepayload2.UI.VBWinUI3.XamlCompiler" Version="3.0.0-dev" />
</ItemGroup>

DevelopmentDependency=true keeps the package private, so no PrivateAssets / ExcludeAssets are needed - adding them would also suppress the buildTransitive import that does the override.

To use the stock compiler instead:

dotnet build -p:VBWinUI3XamlCompilerEnabled=false

Verifying which compiler ran

  1. The build log contains VBWinUI3 XamlCompiler override active: … with all three paths under ~\.nuget\packages\nukepayload2.ui.vbwinui3.xamlcompiler\<version>\tools\.
  2. The generated App.g.i.vb contains Friend Module XamlGeneratedProgram and Sub XamlGeneratedMain().
  3. Every generated file carries GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler", " 3.0.0.0"); the stock 2.2.x compiler stamps 3.0.0.2606.

Incremental builds decide whether to re-run XAML compilation from a fingerprint of the XAML files, references and local assemblies, not of the compiler binaries: delete obj\ and bin\ after switching or repacking the compiler.

Repacking

:: 1. build the compiler in Release (writes BuildOutput\packaging\Release\tools)
Build.cmd product

:: 2. pack into ..\..\PackageStore
build\xamlcompiler-nupkg\pack.cmd

~\.nuget\packages\<id>\<version> is immutable to NuGet, so a repacked version is ignored in favour of the cached copy. Bump the version (pack.cmd -p:PackageVersion=3.0.0-dev.1) or delete the cached folder and restore again.

Differences from the stock tools

  • The Core-MSBuild tool folder is tools\net8.0\ instead of tools\net6.0\; the file names are the same.
  • Only the three binaries above are replaced. The fork's interop.targets also passes EnabledXamlOptionalChanges / DisabledXamlOptionalChanges; that file is not shipped, so those properties stay empty (their default), which only affects the C#/C++ generators.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Nukepayload2.UI.VBWinUI3.XamlCompiler:

Package Downloads
Nukepayload2.UI.VBWinUI3

WinUI 3 build support for Visual Basic projects with automatic MSBuild target integration

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-dev.260913.10 60 9/13/2026
3.0.0-dev.260913.1 60 9/13/2026
3.0.0-dev 46 9/13/2026