KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.41k stars 188 forks source link

Fails to run on Linux #678

Closed notpeelz closed 1 year ago

notpeelz commented 1 year ago

Bug summary

When trying to run the compiled project (Avalonia version) on my Linux machine, this error is printed:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at StructuredLogViewer.Avalonia.App.!XamlIlPopulate(IServiceProvider , App )
   at StructuredLogViewer.Avalonia.App.!XamlIlPopulateTrampoline(App )
   at StructuredLogViewer.Avalonia.App.Initialize() in /home/peelz/MSBuildStructuredLog/src/StructuredLogViewer.Avalonia/App.xaml.cs:line 11
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 310
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 179
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 208
   at StructuredLogViewer.Avalonia.Program.Main(String[] args) in /home/peelz/MSBuildStructuredLog/src/StructuredLogViewer.Avalonia/Program.cs:line 9

How to reproduce

On a fresh Fedora 38 virtual machine:

  1. sudo dnf install dotnet-sdk-6.0
  2. git clone https://github.com/KirillOsenkov/MSBuildStructuredLog.git
  3. cd MSBuildStructuredLog
  4. ./run.sh (or ./PublishNativeAOT.sh then run the published binary)
  5. See error

Other information

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.116
 Commit:    b605cc131f

Runtime Environment:
 OS Name:     fedora
 OS Version:  38
 OS Platform: Linux
 RID:         fedora.38-x64
 Base Path:   /usr/lib64/dotnet/sdk/6.0.116/

global.json file:
  /home/peelz/MSBuildStructuredLog/global.json

Host:
  Version:      6.0.16
  Architecture: x64
  Commit:       1e620a42e7

.NET SDKs installed:
  6.0.116 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.16 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info
KirillOsenkov commented 1 year ago

The latest commit fixes this. pull latest, git clean -xdff, then build.