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

Conversation

makeProjectGreatAgain
Copy link
Contributor

@makeProjectGreatAgain makeProjectGreatAgain commented Nov 10, 2021

This PR will update the ExceptionReporter.NET to support the net5.0-windows TargetFramework

I have tested it manually and all seems OK.
Also, I have run UnitTests for net5.0-windows and 2 of them were red:

    • Can_Dig_Assembly_Refs_By_Name() - I assume it was false negative. This test checked the existence of "System.Core" but it wasn't necessary(?)
    • Can_Render_Text_Template_Baseline_1_Of_Everything() - the problem is in Handlebars 2.0.2. There are newer versions of Handlebars, but them had more bugs (more failed unit tests). Later I will report about it to the maintainers of Handlebars

  • problem with the ApplicationDeployment API in Net5

@makeProjectGreatAgain
Copy link
Contributor Author

I used Simple-MAPI.NET netstandard2.0 version from this PR Simple-MAPI.NET netstandard2.0 target framework

@PandaWood
Copy link
Owner

Thanks yeah, I should pull in the netstandard2 PR from SimpleMAPI first and then come back to this one

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...

@@ -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

@PandaWood
Copy link
Owner

I noticed a lot of people are missing the ApplicationDeployment API in Net5, they're tracking the issue here (we use it twice in ER)
dotnet/deployment-tools#27

One user's solution is this

I noticed he replaces ApplicationDeployment.IsNetworkDeployed
with basically (in summary) AppDomain.CurrentDomain.SetupInformation.ApplicationBase.Contains("AppData\\Local\\Apps")

If we could write something like that, conditional on NET50, maybe...

@PandaWood
Copy link
Owner

PandaWood commented Nov 21, 2021

Actually, reading this MS blog, I get the idea that the most practical option here is to target .netstandard 2.0 - to basically support both .NetFramework and .NET5

https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/

If you’re building reusable libraries that you plan on shipping on NuGet, you’ll want to consider the trade-off between reach and available feature set. .NET Standard 2.0 is the highest version of .NET Standard that is supported by .NET Framework, so it will give you the most reach, while also giving you a fairly large feature set to work with.

@makeProjectGreatAgain
Copy link
Contributor Author

Actually, reading this MS blog, I get the idea that the most practical option here is to target .netstandard 2.0 - to basically support both .NetFramework and .NET5

There is a dependency on WinForms therefore it can't be targeted on .netstandart 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants