Skip to content

Added TargetFramework net8.0-windows#10

Merged
snakefoot merged 9 commits into
NLog:masterfrom
thompson-tomo:chore/#9_AddNet6
Jul 18, 2025
Merged

Added TargetFramework net8.0-windows#10
snakefoot merged 9 commits into
NLog:masterfrom
thompson-tomo:chore/#9_AddNet6

Conversation

@thompson-tomo
Copy link
Copy Markdown
Contributor

This will add net 6 as a TFM and ensure that the dependencies are not added.

Closes #1
Closes #9

Copy link
Copy Markdown
Member

@304NotModified 304NotModified left a comment

Choose a reason for hiding this comment

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

We need also this for .NET8 isn't?

Also we need to update the targets in the unit tests.

The build isn't working, I guess it needs and update the #if statements

@pull-request-size pull-request-size Bot added size/L and removed size/XS labels Apr 7, 2024
@thompson-tomo
Copy link
Copy Markdown
Contributor Author

@304NotModified dotnet 8 is not needed as for dotnet 8 it will use the net 6 compilation. Yes i have gone and adjusted the conditional compiles

@snakefoot
Copy link
Copy Markdown
Contributor

Well NET6 will expire soon (end of year), and then the build-pipeline will explode. So I guess you need to add both NET6 + NET8,

Comment thread src/NLog.WindowsIdentity/ImpersonatingTargetWrapper.cs Outdated
Comment thread src/NLog.WindowsIdentity/ImpersonatingTargetWrapper.cs Outdated
Comment thread src/NLog.WindowsIdentity/ImpersonatingTargetWrapper.cs Outdated
Comment thread src/NLog.WindowsIdentity/ImpersonatingTargetWrapper.cs Outdated
Comment thread src/NLog.WindowsIdentity/ImpersonatingTargetWrapper.cs Outdated
Comment thread src/NLog.WindowsIdentity/NLog.WindowsIdentity.csproj Outdated
Comment thread src/NLog.WindowsIdentity/NativeMethods.cs Outdated
Comment thread src/NLog.WindowsIdentity/NativeMethods.cs Outdated
Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
@thompson-tomo
Copy link
Copy Markdown
Contributor Author

Strongly doubt that it would explode given that pipelines using net core 3 are still operational.

Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
Comment thread tests/NLog.WindowsIdentity.Tests/ImpersonatingTargetWrapperTests.cs Outdated
@snakefoot
Copy link
Copy Markdown
Contributor

snakefoot commented Apr 7, 2024

Can these build-warnings CA1416 be fixed:

NLog.WindowsIdentity -> C:\projects\NLog-WindowsIdentity\src\NLog.WindowsIdentity\bin\Any CPU\Release\net46\NLog.WindowsIdentity.dll
C:\projects\NLog-WindowsIdentity\tests\NLog.WindowsIdentity.Tests\ImpersonatingTargetWrapperTests.cs(133,70): warning CA1416: This call site is reachable on all platforms. 'WindowsIdentity.Name' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416) [C:\projects\NLog-WindowsIdentity\tests\NLog.WindowsIdentity.Tests\NLog.WindowsIdentity.Tests.csproj::TargetFramework=net6.0]

@pull-request-size pull-request-size Bot added size/M and removed size/L labels Apr 7, 2024
@thompson-tomo
Copy link
Copy Markdown
Contributor Author

Can these build-warnings CA1416 be fixed:

NLog.WindowsIdentity -> C:\projects\NLog-WindowsIdentity\src\NLog.WindowsIdentity\bin\Any CPU\Release\net46\NLog.WindowsIdentity.dll
C:\projects\NLog-WindowsIdentity\tests\NLog.WindowsIdentity.Tests\ImpersonatingTargetWrapperTests.cs(133,70): warning CA1416: This call site is reachable on all platforms. 'WindowsIdentity.Name' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416) [C:\projects\NLog-WindowsIdentity\tests\NLog.WindowsIdentity.Tests\NLog.WindowsIdentity.Tests.csproj::TargetFramework=net6.0]

This should also be resolved now

@snakefoot
Copy link
Copy Markdown
Contributor

Then I guess it is "just" a matter of making the build-pipeline green.

@thompson-tomo
Copy link
Copy Markdown
Contributor Author

Then I guess it is "just" a matter of making the build-pipeline green.

hopefully those last changes to the test projects resolve the build pipeline

@thompson-tomo thompson-tomo requested a review from snakefoot April 7, 2024 09:39
Comment thread src/NLog.WindowsIdentity/NLog.WindowsIdentity.csproj Outdated
Comment thread src/NLog.WindowsIdentity/NLog.WindowsIdentity.csproj Outdated
Comment thread src/NLog.WindowsIdentity/NLog.WindowsIdentity.csproj Outdated
@snakefoot
Copy link
Copy Markdown
Contributor

snakefoot commented Apr 11, 2024

Since you are explicitly adding NET6 and NET8, then I guess we should change this:

<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsTrimmable>true</IsTrimmable>

To this:

<EnableTrimAnalyzer Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>
<IsTrimmable Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">true</IsTrimmable>

@pull-request-size pull-request-size Bot added size/S and removed size/M labels Jul 17, 2025
Comment thread src/NLog.WindowsIdentity/NLog.WindowsIdentity.csproj Outdated
@snakefoot snakefoot changed the title #9 add in net 6 Added targetplatform net8.0-windows Jul 18, 2025
@snakefoot snakefoot changed the title Added targetplatform net8.0-windows Added TargetFramework net8.0-windows Jul 18, 2025
@snakefoot snakefoot merged commit 5720923 into NLog:master Jul 18, 2025
3 checks passed
@thompson-tomo thompson-tomo deleted the chore/#9_AddNet6 branch July 19, 2025 01:04
@snakefoot
Copy link
Copy Markdown
Contributor

snakefoot commented Jul 19, 2025

Thank you for the pull-request, and being so persistent. Like the minimal code-changes required to add support for net8.0-windows.

Will publish a new release of NLog.WindowsIdentity to nuget, when NLog v6.0.2 has been released.

@thompson-tomo
Copy link
Copy Markdown
Contributor Author

No worries at all. Glad we got there in the end. 😄

@snakefoot
Copy link
Copy Markdown
Contributor

NLog.WindowsIdentity ver. 6.0.2 has been published:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add additional TFM to reduce dependencies .NET6 includes System.Security.Principal.Windows

3 participants