diff --git a/src/BUTR.CrashReport.Bannerlord.Tool/Program.cs b/src/BUTR.CrashReport.Bannerlord.Tool/Program.cs index caefbb3..e8d0dae 100644 --- a/src/BUTR.CrashReport.Bannerlord.Tool/Program.cs +++ b/src/BUTR.CrashReport.Bannerlord.Tool/Program.cs @@ -1,4 +1,5 @@ using BUTR.CrashReport.Models; +using BUTR.CrashReport.Renderer.Html; using CommandLine; @@ -10,7 +11,6 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; -using BUTR.CrashReport.Renderer.Html; namespace BUTR.CrashReport.Bannerlord.Tool; diff --git a/src/BUTR.CrashReport.Renderer.Html/BUTR.CrashReport.Renderer.Html.csproj b/src/BUTR.CrashReport.Renderer.Html/BUTR.CrashReport.Renderer.Html.csproj index f09181d..0d8c39b 100644 --- a/src/BUTR.CrashReport.Renderer.Html/BUTR.CrashReport.Renderer.Html.csproj +++ b/src/BUTR.CrashReport.Renderer.Html/BUTR.CrashReport.Renderer.Html.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net45;netstandard2.0 enable preview @@ -24,7 +24,7 @@ - + diff --git a/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs b/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs index 1ecbe5f..c133b03 100644 --- a/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs +++ b/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs @@ -1,8 +1,8 @@ +using BUTR.CrashReport.Models; + using System.Collections.Generic; using System.Text; -using BUTR.CrashReport.Models; - namespace BUTR.CrashReport.Renderer.Html; partial class CrashReportHtml diff --git a/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.cs b/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.cs index 14d1a31..02fc16b 100644 --- a/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.cs +++ b/src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.cs @@ -1,13 +1,14 @@ +using BUTR.CrashReport.Models; +using BUTR.CrashReport.Renderer.Html.Extensions; + using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using BUTR.CrashReport.Extensions; -using BUTR.CrashReport.Models; namespace BUTR.CrashReport.Renderer.Html; - + public static partial class CrashReportHtml { private static readonly string MiniDumpTag = ""; @@ -66,7 +67,7 @@ public static string AddData(string htmlReport, string gzipBase64CrashReportJson """); } - + htmlReport = htmlReport .Replace(JsonModelTag, gzipBase64CrashReportJson) .Replace(JsonModelButtonTag, """ @@ -80,7 +81,7 @@ public static string AddData(string htmlReport, string gzipBase64CrashReportJson return htmlReport; } - + public static string Build(CrashReportModel crashReportModel, IEnumerable files) => GetBase(crashReportModel, files); private static string GetRecursiveExceptionHtml(CrashReportModel crashReport, ExceptionModel? ex) @@ -93,7 +94,7 @@ private static string GetRecursiveExceptionHtml(CrashReportModel crashReport, Ex var moduleId = stacktrace?.ExecutingMethod.ModuleId ?? "UNKNOWN"; var sourceModuleId = ex.SourceModuleId ?? "UNKNOWN"; - + var pluginId = stacktrace?.ExecutingMethod.LoaderPluginId ?? "UNKNOWN"; var sourcePluginId = ex.SourceLoaderPluginId ?? "UNKNOWN"; @@ -102,10 +103,10 @@ private static string GetRecursiveExceptionHtml(CrashReportModel crashReport, Ex var hasInner = ex.InnerException is not null; return new StringBuilder() .Append("Exception Information:").Append("
") - .AppendIf(moduleId != "UNKNOWN", sb => sb.Append("Potential Module Id: ").Append("").Append(moduleId).Append("").Append("
")) - .AppendIf(sourceModuleId != "UNKNOWN", sb => sb.Append("Potential Source Module Id: ").Append("").Append(sourceModuleId).Append("").Append("
")) - .AppendIf(pluginId != "UNKNOWN", sb => sb.Append("Potential Plugin Id: ").Append("").Append(pluginId).Append("").Append("
")) - .AppendIf(sourcePluginId != "UNKNOWN", sb => sb.Append("Potential Source Plugin Id: ").Append("").Append(sourcePluginId).Append("").Append("
")) + .AppendIf(moduleId != "UNKNOWN", sb => sb.Append("Potential Module Id: ").Append("").Append(moduleId).Append("").Append("
")) + .AppendIf(sourceModuleId != "UNKNOWN", sb => sb.Append("Potential Source Module Id: ").Append("").Append(sourceModuleId).Append("").Append("
")) + .AppendIf(pluginId != "UNKNOWN", sb => sb.Append("Potential Plugin Id: ").Append("").Append(pluginId).Append("").Append("
")) + .AppendIf(sourcePluginId != "UNKNOWN", sb => sb.Append("Potential Source Plugin Id: ").Append("").Append(sourcePluginId).Append("").Append("
")) .Append("Type: ").Append(ex.Type.EscapeGenerics()).Append("
") .AppendIf(hasMessage, sb => sb.Append("Message: ").Append(ex.Message.EscapeGenerics()).Append("
")) .AppendIf(hasCallStack, sb => sb.Append("Stacktrace:").Append("
")) @@ -139,8 +140,8 @@ private static string GetEnhancedStacktraceHtml(CrashReportModel crashReport) .Append("Executing Method:") .Append("