Skip to content

Conversation

@codito
Copy link
Contributor

@codito codito commented Feb 13, 2025

  • 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
3 checks passed
@codito codito deleted the empty-properties branch February 13, 2025 16:06
@viceice
Copy link
Contributor

viceice commented Mar 11, 2025

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

@codito
Copy link
Contributor Author

codito commented Mar 13, 2025

@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
Copy link
Contributor

viceice commented Mar 13, 2025

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
Copy link
Contributor Author

codito commented Mar 13, 2025

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
Copy link
Contributor Author

codito commented Mar 14, 2025

@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
Copy link
Contributor

viceice commented Mar 14, 2025

will try it

@viceice
Copy link
Contributor

viceice commented Mar 14, 2025

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