Skip to content

Upgrade to .NET 9.0#158

Merged
codito merged 7 commits into
spekt:masterfrom
codito:empty-properties
Feb 13, 2025
Merged

Upgrade to .NET 9.0#158
codito merged 7 commits into
spekt:masterfrom
codito:empty-properties

Conversation

@codito

@codito codito commented Feb 13, 2025

Copy link
Copy Markdown
Contributor
  • Upgrade to .net 9.0
  • Upgrade libs to netstandard2.1. Drop support for .NET full framework test projects

@codito codito changed the title Empty properties Upgrade to .NET 9.0 Feb 13, 2025
@codito codito enabled auto-merge (squash) February 13, 2025 15:51
@codito codito merged commit 4a00352 into spekt:master Feb 13, 2025
@codito codito deleted the empty-properties branch February 13, 2025 16:06
@viceice

viceice commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

So v6+ cann't be used for net4x test projects? 😢

@codito

codito commented Mar 13, 2025

Copy link
Copy Markdown
Contributor Author

@viceice yes the 6.x+ version of this logger uses netstandard2.x which drops support for net4.5.

See https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/9.0/netstandard-warning.

The feature diff between 5.x and 6.x is quite minimal at this time. If the community is interested to contribute, we can back port these and create a 5.1 release.

@viceice

viceice commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

why not using netstandard2.0, so it's still usable with net47+?

we've projects which can't be upgraded to net core (eg SharePoint on premise solution)

https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting

@codito

codito commented Mar 13, 2025

Copy link
Copy Markdown
Contributor Author

It is a funny story why netstandard2.0 didn't work out.

The test logger library has a requirement that it must not be instrumented in code coverage runs. Otherwise, vstest fails to invoke the instrumented logging event handlers and test runs crash.

We achieve this by annotating the assembly with ExcludeFromCodeCoverage attribute. Now it turns out that in netstandard2.0, this attribute is not marked with AttributeTargets.Assembly. netstandard2.1 fixes this bug.

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=netstandard-2.0

In v5.x and earlier versions of test logger, the attribute is missing from the upstream netstandard1.5 library. So we could inject it ourselves in the Diagnostics namespace and workaround. netstandard2.0 doesn't allow us to override the shipping attribute definition in any way :(

@codito

codito commented Mar 14, 2025

Copy link
Copy Markdown
Contributor Author

@viceice I've pushed a hack to force netstandard2.0 target for Junit logger #168.

Would it be possible for you to try this pre-release package and confirm if it works?
https://www.myget.org/feed/spekt/package/nuget/JunitXml.TestLogger

@viceice

viceice commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

will try it

@viceice

viceice commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Continue here👉 #167 (comment)

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.

2 participants