Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link trimming doesn't appear to work with Avalonia 11 (11.0.999-cibuild0026354-beta) #9127

Closed
KieranDevvs opened this issue Oct 8, 2022 · 12 comments · Fixed by #9413 or #9537
Closed
Labels

Comments

@KieranDevvs
Copy link
Contributor

Describe the bug
When publishing a link trimmed self contained, single file executable, the application crashes upon startup.
The error in Event Viewer seems to indicate that it can't find the fluent theme, suggesting that it has been trimmed out, but the project configuration specifies to keep that assembly.

	<ItemGroup>
		<!--This helps with theme dll-s trimming.
	If you will publish your application in self-contained mode with p:PublishTrimmed=true and it will use Fluent theme Default theme will be trimmed from the output and vice versa.
	https://github.com/AvaloniaUI/Avalonia/issues/5593 -->
		<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
		<TrimmableAssembly Include="Avalonia.Themes.Default" />
	</ItemGroup>
Application: AvaloniaTrimmingTest.exe
CoreCLR Version: 6.0.922.41905
.NET Version: 6.0.9
Description: The process was terminated due to an unhandled exception.
Exception Info: Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Avalonia.Themes.Fluent/Accents/AccentColors.xaml (baseUri: avares://AvaloniaTrimmingTest/App.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource
   at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Uri uri, Uri baseUri) in /_/src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoader.cs:line 74
   at Avalonia.Markup.Xaml.Styling.StyleInclude.get_Loaded() in /_/src/Markup/Avalonia.Markup.Xaml/Styling/StyleInclude.cs:line 54
   at Avalonia.Markup.Xaml.Styling.StyleInclude.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost owner) in /_/src/Markup/Avalonia.Markup.Xaml/Styling/StyleInclude.cs:line 98
   at Avalonia.Styling.Styles.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost ) in /_/src/Avalonia.Base/Styling/Styles.cs:line 212
   at Avalonia.Styling.Styles.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost ) in /_/src/Avalonia.Base/Styling/Styles.cs:line 212
   at Avalonia.Themes.Fluent.FluentTheme.Avalonia.Controls.IResourceProvider.AddOwner(IResourceHost ) in /_/src/Avalonia.Themes.Fluent/FluentTheme.cs:line 190
   at Avalonia.Styling.Styles.InternalAdd(IList , IResourceHost , StyleCache& ) in /_/src/Avalonia.Base/Styling/Styles.cs:line 257
   at Avalonia.Styling.Styles.OnCollectionChanged(Object , NotifyCollectionChangedEventArgs ) in /_/src/Avalonia.Base/Styling/Styles.cs:line 303
   at Avalonia.Collections.AvaloniaList`1.NotifyAdd(T , Int32 ) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 700
   at Avalonia.Collections.AvaloniaList`1.Add(T ) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 205
   at Avalonia.Styling.Styles.Add(IStyle ) in /_/src/Avalonia.Base/Styling/Styles.cs:line 173
   at AvaloniaTrimmingTest.App.!XamlIlPopulate(IServiceProvider , App ) in C:\Users\Kieran Devlin\source\repos\AvaloniaTrimmingTest\AvaloniaTrimmingTest\App.axaml:line 10
   at AvaloniaTrimmingTest.App.!XamlIlPopulateTrampoline(App )
   at AvaloniaTrimmingTest.App.Initialize() in C:\Users\Kieran Devlin\source\repos\AvaloniaTrimmingTest\AvaloniaTrimmingTest\App.axaml.cs:line 13
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 287
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 148
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 208
   at AvaloniaTrimmingTest.Program.Main(String[] args) in C:\Users\Kieran Devlin\source\repos\AvaloniaTrimmingTest\AvaloniaTrimmingTest\Program.cs:line 14

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Avalonia MVVM project, upgrade the Avalonia packages to 11 (preview 2)
  2. Configure the project for trimming, single file publishing.
    <PublishSingleFile>true</PublishSingleFile>
    <PublishTrimmed>true</PublishTrimmed>
    <TrimMode>link</TrimMode>
  1. Publish as self contained (win-x64)
  2. Run the executable in the output directory.
  3. See error in Event Viewer.

Expected behavior
The trimmed executable to run.

Screenshots
N/a

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 11 preview 2

Additional context
N/a

@KieranDevvs KieranDevvs added the bug label Oct 8, 2022
@KieranDevvs KieranDevvs changed the title Link trimming doesn't appear to work with Avalonia 11 Link trimming doesn't appear to work with Avalonia 11 (Preview 2) Oct 8, 2022
@hez2010
Copy link
Contributor

hez2010 commented Oct 9, 2022

Avalonia is not compatible with link trimming for now. But you can workaround it with TrimmerRootDescriptor:

<linker>
  <assembly fullname="your main assembly name" preserve="all" />

  <assembly fullname="Avalonia.Base">
    <type fullname="Avalonia.Animation.Animators.TransformAnimator" />
  </assembly>

  <!-- for all assemblies that have xaml code -->
  <assembly fullname="xxxx">
    <type fullname="CompiledAvaloniaXaml.!AvaloniaResources" />
    <type fullname="CompiledAvaloniaXaml.!IndexerAccessorFactoryClosure" />
    <type fullname="CompiledAvaloniaXaml.!XamlLoader" />
    <type fullname="CompiledAvaloniaXaml.XamlIlContext" />
    <type fullname="CompiledAvaloniaXaml.XamlIlContext/ParentStackEnumerable/Enumerator" />
    <type fullname="CompiledAvaloniaXaml.XamlIlHelpers" />
    <type fullname="CompiledAvaloniaXaml.XamlIlTrampolines" />
  </assembly>

  <assembly fullname="System.Private.CoreLib">
    <type fullname="System.StubHelpers.InterfaceMarshaler" preserve="all" />
  </assembly>
</linker>

@KieranDevvs
Copy link
Contributor Author

Avalonia is not compatible with link trimming for now. But you can workaround it with TrimmerRootDescriptor:

<linker>
  <assembly fullname="your main assembly name" preserve="all" />

  <assembly fullname="Avalonia.Base">
    <type fullname="Avalonia.Animation.Animators.TransformAnimator" />
  </assembly>

  <!-- for all assemblies that have xaml code -->
  <assembly fullname="xxxx">
    <type fullname="CompiledAvaloniaXaml.!AvaloniaResources" />
    <type fullname="CompiledAvaloniaXaml.!IndexerAccessorFactoryClosure" />
    <type fullname="CompiledAvaloniaXaml.!XamlLoader" />
    <type fullname="CompiledAvaloniaXaml.XamlIlContext" />
    <type fullname="CompiledAvaloniaXaml.XamlIlContext/ParentStackEnumerable/Enumerator" />
    <type fullname="CompiledAvaloniaXaml.XamlIlHelpers" />
    <type fullname="CompiledAvaloniaXaml.XamlIlTrampolines" />
  </assembly>

  <assembly fullname="System.Private.CoreLib">
    <type fullname="System.StubHelpers.InterfaceMarshaler" preserve="all" />
  </assembly>
</linker>

Im confused:

It was fixed in 11.0 preview.

Originally posted by @maxkatz6 in #6892 (comment)

@hez2010
Copy link
Contributor

hez2010 commented Oct 10, 2022

It works with TrimMode=copyused.

@maxkatz6
Copy link
Member

Yes, it seems we still have a problem with StyleInclude.

@hez2010
Copy link
Contributor

hez2010 commented Oct 10, 2022

Also the problem with UI automation (we need to replace them with ComWrappers)

@KieranDevvs
Copy link
Contributor Author

KieranDevvs commented Nov 23, 2022

@jmacato Can this be re-opened? I've attempted the same action with the build from the PR that closed this issue and this does not appear to have been resolved.

I'm getting an IL linker error when publishing trimmed in .NET 7 & version 11.0.999-cibuild0026354-beta:
image

>------ Publish started: Project: AvaloniaTrimmingTest, Configuration: Release Any CPU ------
2>Determining projects to restore...
2>All projects are up-to-date for restore.
2>Could not extract the MVID from "obj\Release\net7.0\win-x64\refint\AvaloniaTrimmingTest.dll". Are you sure it is a reference assembly?
2>AvaloniaTrimmingTest -> C:\Users\kieran.devlin\Documents\git\sources\AvaloniaTrimmingTest\AvaloniaTrimmingTest\bin\Release\net7.0\win-x64\AvaloniaTrimmingTest.dll
2>Optimizing assemblies for size. This process might take a while.
2>C:\Program Files\dotnet\dotnet.exe "C:\Program Files\dotnet\sdk\7.0.100\Sdks\Microsoft.NET.ILLink.Tasks\tools\net7.0\illink.dll" -a "obj\Release\net7.0\win-x64\AvaloniaTrimmingTest.dll"
2>--singlewarn
2>--trim-mode Link
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Base.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Controls.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.DesignerSupport.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Dialogs.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Markup.Xaml.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Markup.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.MicroCom.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.OpenGL.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.desktop\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Desktop.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.freedesktop\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.FreeDesktop.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.native\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Native.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.reactiveui\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.ReactiveUI.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.remote.protocol\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Remote.Protocol.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.skia\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Skia.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.win32\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Win32.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.x11\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.X11.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\dynamicdata\7.9.5\lib\net6.0\DynamicData.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\harfbuzzsharp\2.8.2.1-preview.108\lib\net6.0\HarfBuzzSharp.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\jetbrains.annotations\10.3.0\lib\netstandard1.0\JetBrains.Annotations.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microcom.runtime\0.11.0\lib\net5.0\MicroCom.Runtime.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.win32.systemevents\6.0.0\runtimes\win\lib\net6.0\Microsoft.Win32.SystemEvents.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\reactiveui\18.3.1\lib\net6.0\ReactiveUI.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\skiasharp\2.88.1\lib\net6.0\SkiaSharp.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\splat\14.4.1\lib\net6.0\Splat.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\system.drawing.common\6.0.0\runtimes\win\lib\net6.0\System.Drawing.Common.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\system.reactive\5.0.0\lib\net5.0\System.Reactive.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\tmds.dbus\0.9.0\lib\netstandard2.0\Tmds.DBus.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\Microsoft.CSharp.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\Microsoft.VisualBasic.Core.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\Microsoft.VisualBasic.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\Microsoft.Win32.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\Microsoft.Win32.Registry.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.AppContext.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Buffers.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Collections.Concurrent.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Collections.Immutable.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Collections.NonGeneric.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Collections.Specialized.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Collections.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.Annotations.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.DataAnnotations.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.EventBasedAsync.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.TypeConverter.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ComponentModel.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Configuration.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Console.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Core.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Data.Common.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Data.DataSetExtensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Data.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.Contracts.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.Debug.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.DiagnosticSource.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.FileVersionInfo.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.Process.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.StackTrace.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.TextWriterTraceListener.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.Tools.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.TraceSource.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Diagnostics.Tracing.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Drawing.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Drawing.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Dynamic.Runtime.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Formats.Asn1.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Formats.Tar.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Globalization.Calendars.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Globalization.Extensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Globalization.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Compression.Brotli.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Compression.FileSystem.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Compression.ZipFile.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Compression.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.FileSystem.AccessControl.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.FileSystem.DriveInfo.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.FileSystem.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.FileSystem.Watcher.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.FileSystem.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.IsolatedStorage.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.MemoryMappedFiles.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Pipes.AccessControl.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.Pipes.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.UnmanagedMemoryStream.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.IO.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Linq.Expressions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Linq.Parallel.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Linq.Queryable.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Linq.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Memory.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Http.Json.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Http.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.HttpListener.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Mail.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.NameResolution.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.NetworkInformation.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Ping.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Quic.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Requests.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Security.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.ServicePoint.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.Sockets.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.WebClient.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.WebHeaderCollection.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.WebProxy.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.WebSockets.Client.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.WebSockets.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Net.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Numerics.Vectors.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Numerics.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ObjectModel.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Private.CoreLib.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Private.DataContractSerialization.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Private.Uri.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Private.Xml.Linq.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Private.Xml.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.DispatchProxy.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Emit.ILGeneration.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Emit.Lightweight.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Emit.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Extensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Metadata.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.TypeExtensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Reflection.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Resources.Reader.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Resources.ResourceManager.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Resources.Writer.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.CompilerServices.Unsafe.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.CompilerServices.VisualC.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Extensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Handles.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.InteropServices.JavaScript.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.InteropServices.RuntimeInformation.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.InteropServices.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Intrinsics.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Loader.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Numerics.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Serialization.Formatters.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Serialization.Json.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Serialization.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Serialization.Xml.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.Serialization.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Runtime.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.AccessControl.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Claims.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.Algorithms.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.Cng.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.Csp.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.Encoding.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.OpenSsl.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.Primitives.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.X509Certificates.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Cryptography.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Principal.Windows.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.Principal.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.SecureString.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Security.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ServiceModel.Web.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ServiceProcess.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.Encoding.CodePages.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.Encoding.Extensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.Encoding.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.Encodings.Web.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.Json.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Text.RegularExpressions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Channels.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Overlapped.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Tasks.Dataflow.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Tasks.Extensions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Tasks.Parallel.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Tasks.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Thread.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.ThreadPool.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.Timer.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Threading.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Transactions.Local.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Transactions.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.ValueTuple.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Web.HttpUtility.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Web.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Windows.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.Linq.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.ReaderWriter.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.Serialization.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.XDocument.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.XPath.XDocument.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.XPath.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.XmlDocument.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.XmlSerializer.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.Xml.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\System.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\WindowsBase.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\mscorlib.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\microsoft.netcore.app.runtime.win-x64\7.0.0\runtimes\win-x64\lib\net7.0\netstandard.dll"
2>-reference "C:\Users\kieran.devlin\.nuget\packages\avalonia.themes.fluent\11.0.999-cibuild0026507-beta\lib\net6.0\Avalonia.Themes.Fluent.dll"
2>--action Link "Avalonia.Themes.Fluent"
2>-reference "obj\Release\net7.0\win-x64\AvaloniaTrimmingTest.dll"
2>--singlewarn- "AvaloniaTrimmingTest"
2>-out "obj\Release\net7.0\win-x64\linked"
2>--nowarn "1701;1702;IL2121;1701;1702;2008"
2>--warn "5"
2>--warnaserror- --warnaserror ";NU1605;SYSLIB0011"
2>--feature Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability true
2>--feature System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization false
2>--feature System.Reflection.Metadata.MetadataUpdater.IsSupported false
2>--feature System.Resources.ResourceManager.AllowCustomResourceTypes false
2>--feature System.Runtime.InteropServices.BuiltInComInterop.IsSupported true
2>--feature System.Runtime.InteropServices.EnableConsumingManagedCodeFromNativeHosting false
2>--feature System.Runtime.InteropServices.EnableCppCLIHostActivation false
2>--feature System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization false
2>--feature System.StartupHookProvider.IsSupported false
2>--feature System.Threading.Thread.EnableAutoreleasePool false
2>--feature System.Text.Encoding.EnableUnsafeUTF7Encoding false
2>-b
2>--skip-unresolved true 
2>
2>IL Trimmer has encountered an unexpected error. Please report the issue at https://github.com/dotnet/linker/issues
2>Fatal error in IL Linker
2>Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'document')
2>   at Mono.Cecil.Cil.SequencePoint..ctor(Int32 offset, Document document)
2>   at Mono.Cecil.SignatureReader.ReadSequencePoints(Document document)
2>   at Mono.Cecil.MetadataReader.ReadSequencePoints(MethodDefinition method)
2>   at Mono.Cecil.Cil.PortablePdbReader.ReadSequencePoints(MethodDebugInformation method_info)
2>   at Mono.Cecil.Cil.PortablePdbReader.Read(MethodDefinition method)
2>   at Mono.Cecil.Cil.EmbeddedPortablePdbReader.Read(MethodDefinition method)
2>   at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
2>   at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
2>   at Mono.Cecil.MetadataReader.ReadMethodBody(MethodDefinition method)
2>   at Mono.Cecil.MethodDefinition.<>c.<get_Body>b__41_0(MethodDefinition method, MetadataReader reader)
2>   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
2>   at Mono.Cecil.MethodDefinition.get_Body()
2>   at Mono.Linker.Dataflow.CompilerGeneratedState.<GetCompilerGeneratedStateForType>g__ProcessMethod|11_0(MethodDefinition method, <>c__DisplayClass11_0&)
2>   at Mono.Linker.Dataflow.CompilerGeneratedState.GetCompilerGeneratedStateForType(TypeDefinition type)
2>   at Mono.Linker.Dataflow.CompilerGeneratedState.TryGetCompilerGeneratedCalleesForUserMethod(MethodDefinition method, List`1& callees)
2>   at Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner)
2>   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
2>   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason, MessageOrigin& origin)
2>   at Mono.Linker.Steps.MarkStep.ProcessQueue()
2>   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
2>   at Mono.Linker.Steps.MarkStep.Process()
2>   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
2>   at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
2>   at Mono.Linker.Pipeline.Process(LinkContext context)
2>   at Mono.Linker.Driver.Run(ILogger customLogger)
2>   at Mono.Linker.Driver.Main(String[] args)
2>Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:09.944 ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
========== Elapsed 00:09.944 ==========

@KieranDevvs KieranDevvs changed the title Link trimming doesn't appear to work with Avalonia 11 (Preview 2) Link trimming doesn't appear to work with Avalonia 11 (11.0.999-cibuild0026354-beta) Nov 23, 2022
@maxkatz6 maxkatz6 reopened this Nov 23, 2022
@KieranDevvs
Copy link
Contributor Author

#9537 does fix the link trimming failure, but the trimmed binary still does not run.
Windows Event Viewer logs when running the published trimmed binary:

Application: AvaloniaTrimmingTest.exe
CoreCLR Version: 7.0.22.51805
.NET Version: 7.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeLoadException
   at CompiledAvaloniaXaml.XamlIlContext.ParentStackEnumerable.GetEnumerator()
   at CompiledAvaloniaXaml.XamlIlContext.ParentStackEnumerable.System.Collections.IEnumerable.GetEnumerator()
   at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1)
   at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.DeferredTransformationFactoryV2[T](Func`2, IServiceProvider)
   at CompiledAvaloniaXaml.!AvaloniaResources.Populate:/Accents/Base.xaml(IServiceProvider, ResourceDictionary) in D:\a\1\s\src\Avalonia.Themes.Fluent\Accents/Base.xaml:line 15
   at CompiledAvaloniaXaml.!AvaloniaResources.Build:/Accents/Base.xaml(IServiceProvider) in D:\a\1\s\src\Avalonia.Themes.Fluent\Accents/Base.xaml:line 1
   at Avalonia.Themes.Fluent.FluentTheme.!XamlIlPopulate(IServiceProvider, FluentTheme) in D:\a\1\s\src\Avalonia.Themes.Fluent\FluentTheme.xaml:line 8
   at Avalonia.Themes.Fluent.FluentTheme.!XamlIlPopulateTrampoline(FluentTheme)
   at Avalonia.Themes.Fluent.FluentTheme..ctor() in /_/src/Avalonia.Themes.Fluent/FluentTheme.xaml.cs:line 36
   at AvaloniaTrimmingTest.App.!XamlIlPopulate(IServiceProvider, App) in C:\Users\kieran.devlin\Documents\git\sources\AvaloniaTrimmingTest\AvaloniaTrimmingTest\App.axaml:line 10
   at AvaloniaTrimmingTest.App.!XamlIlPopulateTrampoline(App)
   at AvaloniaTrimmingTest.App.Initialize() in C:\Users\kieran.devlin\Documents\git\sources\AvaloniaTrimmingTest\AvaloniaTrimmingTest\App.axaml.cs:line 13
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 287
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 148
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T, String[], ShutdownMode ) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 208
   at AvaloniaTrimmingTest.Program.Main(String[]) in C:\Users\kieran.devlin\Documents\git\sources\AvaloniaTrimmingTest\AvaloniaTrimmingTest\Program.cs:line 14

@maxkatz6
Copy link
Member

@KieranDevvs please attach full stack trace of the inner exception as well if there are similar errors.
I was able to reproduce it and here's unwrapped exception:

System.TypeLoadException: Method 'Dispose' in type 'Enumerator' from assembly 'Avalonia.Themes.Fluent, Version=11.0.999.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b' does not have an implementation.
   at CompiledAvaloniaXaml.XamlIlContext.ParentStackEnumerable.GetEnumerator()
   at CompiledAvaloniaXaml.XamlIlContext.ParentStackEnumerable.System.Collections.IEnumerable.GetEnumerator()
   at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable)+MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1)
   at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.DeferredTransformationFactoryV2[T](Func`2, IServiceProvider)
   at CompiledAvaloniaXaml.!AvaloniaResources.Populate:/Accents/Base.xaml(IServiceProvider, ResourceDictionary) in \src\Avalonia.Themes.Fluent\Accents/Base.xaml:line 15
   at CompiledAvaloniaXaml.!AvaloniaResources.Build:/Accents/Base.xaml(IServiceProvider) in \src\Avalonia.Themes.Fluent\Accents/Base.xaml:line 1
   at Avalonia.Themes.Fluent.FluentTheme.!XamlIlPopulate(IServiceProvider, FluentTheme) in \src\Avalonia.Themes.Fluent\FluentTheme.xaml:line 8
   at Avalonia.Themes.Fluent.FluentTheme.!XamlIlPopulateTrampoline(FluentTheme)
   at Avalonia.Themes.Fluent.FluentTheme..ctor() in \src\Avalonia.Themes.Fluent\FluentTheme.xaml.cs:line 36
   at Sandbox.App.!XamlIlPopulate(IServiceProvider, App) in \samples\Sandbox\App.axaml:line 1
   at Sandbox.App.!XamlIlPopulateTrampoline(App)
   at Sandbox.App.Initialize() in \samples\Sandbox\App.axaml.cs:line 11
   at Avalonia.Controls.AppBuilderBase`1.Setup() in \src\Avalonia.Controls\AppBuilderBase.cs:line 287
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime) in \src\Avalonia.Controls\AppBuilderBase.cs:line 148
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T, String[], ShutdownMode ) in \src\Avalonia.Controls\ApplicationLifetimes\ClassicDesktopStyleApplicationLifetime.cs:line 208
   at Sandbox.Program.Main(String[]) in \samples\Sandbox\Program.cs:line 13

@maxkatz6
Copy link
Member

@KieranDevvs can you test again with this build #9537 (comment) ?
It works with control catalog and sandbox.

@KieranDevvs
Copy link
Contributor Author

KieranDevvs commented Nov 26, 2022

@KieranDevvs can you test again with this build #9537 (comment) ? It works with control catalog and sandbox.

So with that build, I get a step further, Im able to publish and run the trimmed binary however, when the window launches, none of the controls are rendered and I don't see any exceptions in Windows Event Viewer this time.

What I get if I run an untrimmed build:
image

What I get if I run a trimmed (self contained) build:
image

Edit: Just did a little more investigation and it looks like the controls are rendering but its the binding that doesnt have a value. If I had to guess, I would say that the ViewModel with the binding value has been detected as unused & trimmed from the published assembly.

image

Another Edit: I can confirm the view model bindings have been trimmed:
image

@maxkatz6
Copy link
Member

@KieranDevvs are you using compiled bindings? It won't ever work with reflection bindings.

https://docs.avaloniaui.net/docs/data-binding/compiledbindings

@KieranDevvs
Copy link
Contributor Author

KieranDevvs commented Nov 26, 2022

@KieranDevvs are you using compiled bindings? It won't ever work with reflection bindings.

https://docs.avaloniaui.net/docs/data-binding/compiledbindings

Ah that worked, thanks, I appreciate the help.
#9537 can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment