Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net5.0-windows #59

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ packages/
.vscode
*.orig
MigrationBackup
/src/ExceptionReporter.WinForms/Properties/PublishProfiles/FolderProfile.pubxml
7 changes: 4 additions & 3 deletions src/ExceptionReporter.Shared/ReportGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Collections.Generic;
using System.Deployment.Application;
using System.Reflection;
using ExceptionReporting.Core;
using ExceptionReporting.Report;
Expand Down Expand Up @@ -46,8 +45,10 @@ public ReportGenerator(ExceptionReportInfo reportInfo)

private string GetAppVersion()
{
return ApplicationDeployment.IsNetworkDeployed ?
ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString() : _info.AppAssembly.GetName().Version.ToString();
return _info.AppAssembly.GetName().Version.ToString();
// lost during migration to net5.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bugger isn't it...
On my current team, this ClickOnce deployed version is quite important - we might have to use conditional code/preprocessing or something to keep this...

//return ApplicationDeployment.IsNetworkDeployed ?
// ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString() : _info.AppAssembly.GetName().Version.ToString();
}

/// <summary>
Expand Down
21 changes: 13 additions & 8 deletions src/ExceptionReporter.WinForms/ExceptionReporter.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<AssemblyName>ExceptionReporter.NET</AssemblyName>
<PackageId>ExceptionReporter</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net40</TargetFrameworks>
<TargetFrameworks>net40;net5.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ReleaseVersion>5.0</ReleaseVersion>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/PandaWood/ExceptionReporter.NET</PackageProjectUrl>
Expand All @@ -13,10 +15,17 @@
<EmbeddedResource Remove="Properties\Resources.en.resx" />
<EmbeddedResource Remove="Properties\Resources.ru.resx" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<PackageReference Include="Simple-MAPI.NET" Version="1.2.0" />
<PackageReference Include="DotNetZip" Version="1.15.0" />
<PackageReference Include="Handlebars.Net" Version="1.9.0" />
<PackageReference Include="Simple-MAPI.NET" Version="1.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows' ">
<PackageReference Include="Simple-MAPI.NET" Version="1.2.1" />
<PackageReference Include="DotNetZip" Version="1.15.0" />
<PackageReference Include="Handlebars.Net" Version="2.0.2" />
<PackageReference Include="System.Management" Version="6.0.0" />
<PackageReference Include="System.Resources.Extensions" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.en.resx">
Expand All @@ -29,14 +38,10 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Reference Include="System.Configuration" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<PropertyGroup>
<Version>5.0</Version>
<Version>5.0.1</Version>
<FileVersion>5.0.0.0</FileVersion>
<Authors>Peter van der Woude, Simon Cropp</Authors>
<Description>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</Description>
Expand Down
4 changes: 3 additions & 1 deletion src/Tests/AssemblyDigger_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ 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"}));
//TODO: is "System.Core" necessesary here?
//Assert.That(refs.Select(r => r.Name), Is.SupersetOf(new [] {"System.Core", "DotNetZip", "SimpleMapi.NET"}));//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah no, System.Core isn't necessary here.
This is just a slightly dodgy "integration" test I did... testing for DLLs I knew should be there, at the time. We can just remove that check

Assert.That(refs.Select(r => r.Name), Is.SupersetOf(new [] {"DotNetZip", "SimpleMapi.NET", "Handlebars" }));
}

[Test]
Expand Down
4 changes: 4 additions & 0 deletions src/Tests/ReportBuilder_Tests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
27 changes: 17 additions & 10 deletions src/Tests/Tests.ExceptionReporter.NET.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFrameworks>net472;net5.0-windows</TargetFrameworks>
<RootNamespace>Tests.ExceptionReporting</RootNamespace>
<ReleaseVersion>4.0.3</ReleaseVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMoq" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="AutoMoq" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows' ">
<PackageReference Include="System.Management" Version="6.0.0" />
<PackageReference Include="AutoMoqCore" Version="2.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
</ItemGroup>
<ItemGroup>
<None Remove="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ExceptionReporter.WinForms\ExceptionReporter.WinForms.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Deployment" />
<Reference Include="System.Management" />
</ItemGroup>
<ItemGroup>
Expand Down