AssemblyDiagnosticsAccessor doesn't work on Linux binaries
When trying to use AssemblyDiagnosticsAccessor or the default SparkleUpdater.Configuration, a runtime error will be thrown giving the following stacktrace:
Unhandled exception. NetSparkleUpdater.NetSparkleException: Error: NetSparkleUpdater is missing the company or product name tag in the assembly accessor (NetSparkleUpdater.AssemblyAccessors.AssemblyDiagnosticsAccessor)
at NetSparkleUpdater.Configurations.JSONConfiguration.GetSavePath()
at NetSparkleUpdater.Configurations.JSONConfiguration..ctor(IAssemblyAccessor assemblyAccessor, String savePath)
at NetSparkleUpdater.Configurations.JSONConfiguration..ctor(IAssemblyAccessor assemblyAccessor)
at ShinRyuModManager.UserInterface.Updater.AutoUpdating.Init()
at ShinRyuModManager.UserInterface.Views.MainWindow..ctor()
at ShinRyuModManager.UserInterface.App.OnFrameworkInitializationCompleted()
at Avalonia.AppBuilder.SetupUnsafe()
at Avalonia.AppBuilder.Setup()
at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
at ShinRyuModManager.Program.Main(String[] args)
According to the error, it claims that I'm missing a <Company> or <Product> tag, but on my builds, I have both of those set. Here's a snippet of my *.csproj
<!-- Versioning -->
<AssemblyVersion>1.2.2</AssemblyVersion>
<VersionPrefix>$(AssemblyVersion)</VersionPrefix>
<AssemblyTitle>ShinRyuModManager-CE</AssemblyTitle>
<Company>SRMM Studio</Company>
<Product>ShinRyuModManager-CE</Product>
<Copyright>2025 SRMM Studio</Copyright>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
I believe this might be a problem with using FileVersionInfo.GetVersionInfo() on a Linux binary, as referenced here. Forcing the use of reflection with Configuration = new JSONConfiguration(new AssemblyReflectionAccessor(null)) has worked just fine though.
Thanks for the report!
Hmm...interesting link you've posted.
I'm wondering if that is the case for both executables and DLL files or just executables. I can't test this out right now, but I'm wondering if NetSparkle is trying to read an executable rather than a DLL, and if it was reading a DLL if things would work out properly. Could be testing by passing in the appropriate path(s) to AssemblyDiagnosticsAccessor.