diff --git a/.gitignore b/.gitignore index 18a24f08..eabbb582 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ packages/ .vscode *.orig MigrationBackup +/src/ExceptionReporter.WinForms/Properties/PublishProfiles/FolderProfile.pubxml diff --git a/src/ExceptionReporter.Shared/ReportGenerator.cs b/src/ExceptionReporter.Shared/ReportGenerator.cs index f17614d8..403af09a 100644 --- a/src/ExceptionReporter.Shared/ReportGenerator.cs +++ b/src/ExceptionReporter.Shared/ReportGenerator.cs @@ -4,7 +4,9 @@ using System; using System.Collections.Generic; +#if NETFRAMEWORK using System.Deployment.Application; +#endif using System.Reflection; using ExceptionReporting.Core; using ExceptionReporting.Report; @@ -42,14 +44,18 @@ public ReportGenerator(ExceptionReportInfo reportInfo) _info.AppName = _info.AppName.IsEmpty() ? _info.AppAssembly.GetName().Name: _info.AppName; _info.AppVersion = _info.AppVersion.IsEmpty() ? GetAppVersion() : _info.AppVersion; _info.ExceptionDate = _info.ExceptionDateKind != DateTimeKind.Local ? DateTime.UtcNow : DateTime.Now; - } + } private string GetAppVersion() { - return ApplicationDeployment.IsNetworkDeployed ? +#if NETFRAMEWORK + return ApplicationDeployment.IsNetworkDeployed ? ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString() : _info.AppAssembly.GetName().Version.ToString(); +#else + return _info.AppAssembly.GetName().Version.ToString(); +#endif } - + /// /// Generate the exception report /// diff --git a/src/ExceptionReporter.WinForms/ExceptionReporter.WinForms.csproj b/src/ExceptionReporter.WinForms/ExceptionReporter.WinForms.csproj index 614179bc..f223ba37 100644 --- a/src/ExceptionReporter.WinForms/ExceptionReporter.WinForms.csproj +++ b/src/ExceptionReporter.WinForms/ExceptionReporter.WinForms.csproj @@ -4,7 +4,9 @@ ExceptionReporter.NET ExceptionReporter true - net40 + net40;net5.0-windows + true + true 5.0 https://github.com/PandaWood/ExceptionReporter.NET @@ -13,10 +15,18 @@ - + + + - + + + + + + + @@ -29,14 +39,10 @@ - - - - - 5.0 + 5.0.1 5.0.0.0 Peter van der Woude, Simon Cropp ExceptionReporter is a .NET UserControl/Dialog that gathers detailed information on an Exception and the application/system running it. It allows the user to copy, save or email a report to the developer diff --git a/src/Tests/AssemblyDigger_Tests.cs b/src/Tests/AssemblyDigger_Tests.cs index 73768997..4cd3866b 100644 --- a/src/Tests/AssemblyDigger_Tests.cs +++ b/src/Tests/AssemblyDigger_Tests.cs @@ -13,7 +13,7 @@ public void Can_Dig_Assembly_Refs_By_Name() var digger = new AssemblyDigger(Assembly.Load("ExceptionReporter.NET")); var refs = digger.GetAssemblyRefs().ToList(); - Assert.That(refs.Select(r => r.Name), Is.SupersetOf(new [] {"System.Core", "DotNetZip", "SimpleMapi.NET"})); + Assert.That(refs.Select(r => r.Name), Is.SupersetOf(new [] {"DotNetZip", "SimpleMapi.NET", "Handlebars" })); } [Test] diff --git a/src/Tests/ReportBuilder_Tests.cs b/src/Tests/ReportBuilder_Tests.cs index e48432d5..2f7a1c58 100644 --- a/src/Tests/ReportBuilder_Tests.cs +++ b/src/Tests/ReportBuilder_Tests.cs @@ -1,6 +1,10 @@ using System.Collections.Generic; using System.Linq; +#if !NETCOREAPP using AutoMoq; +#else +using AutoMoqCore; +#endif using ExceptionReporting; using ExceptionReporting.Report; using ExceptionReporting.SystemInfo; diff --git a/src/Tests/Tests.ExceptionReporter.NET.csproj b/src/Tests/Tests.ExceptionReporter.NET.csproj index 09edb584..5779003f 100644 --- a/src/Tests/Tests.ExceptionReporter.NET.csproj +++ b/src/Tests/Tests.ExceptionReporter.NET.csproj @@ -1,16 +1,24 @@ - + - net472 + net472;net5.0-windows Tests.ExceptionReporting 4.0.3 - - - - - - - + + + + + + + + + + + + + + + @@ -18,7 +26,6 @@ -