Skip to content

Commit

Permalink
Removed installation
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasArdal committed Dec 4, 2024
1 parent 69d9773 commit 3e28372
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/Elmah.Io.WinUI/ElmahIoWinUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Elmah.Io.WinUI
public static class ElmahIoWinUI
{
internal static readonly string _assemblyVersion = typeof(ElmahIoWinUI).Assembly.GetName().Version?.ToString() ?? "Unknown";
internal static readonly string _elmahIoClientAssemblyVersion = typeof(IElmahioAPI).Assembly.GetName().Version?.ToString() ?? "Unknown";
internal static readonly string _winUiAssemblyVersion = typeof(Application).Assembly.GetName().Version?.ToString() ?? "Unknown";

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
Expand Down Expand Up @@ -57,8 +56,6 @@ public static void Init(ElmahIoWinUIOptions options)

Application.Current.UnhandledException += (sender, args) =>
Log(args.Exception);

CreateInstallation();
}

/// <summary>
Expand Down Expand Up @@ -153,37 +150,5 @@ private static string UserAgent()
.Append(new ProductInfoHeaderValue(new ProductHeaderValue("Microsoft.WinUI", _winUiAssemblyVersion)).ToString())
.ToString();
}

private static void CreateInstallation()
{
try
{
var loggerInfo = new LoggerInfo
{
Type = "Elmah.Io.WinUI",
Properties = [],
ConfigFiles = [],
Assemblies =
[
new AssemblyInfo { Name = "Elmah.Io.WinUI", Version = _assemblyVersion },
new AssemblyInfo { Name = "Elmah.Io.Client", Version = _elmahIoClientAssemblyVersion },
new AssemblyInfo { Name = "Microsoft.WindowsAppSDK", Version = _winUiAssemblyVersion }
],
};

var installation = new CreateInstallation
{
Type = "windowsapp",
Name = _options.Application,
Loggers = [loggerInfo]
};

_logger.Installations.Create(_options.LogId.ToString(), installation);
}
catch
{
// We don't want to crash the entire application if the installation fails. Carry on.
}
}
}
}

0 comments on commit 3e28372

Please sign in to comment.