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

Remove code that is unused in .NET 8 #2991

Merged
merged 13 commits into from
Nov 14, 2024
Merged

Conversation

MichelZ
Copy link
Contributor

@MichelZ MichelZ commented Nov 8, 2024

There's code marked as !NET8_0_OR_GREATER in the netcore project, or NET && !NET8_0_OR_GREATER in the shared project that can be removed, now that the only supported .NET (Core) version is 8+

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 8, 2024

image

"I love the smell of dead code in the morning" 😄

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 8, 2024

Should also fix #303 I think

@@ -217,9 +217,6 @@
<Compile Include="$(CommonSourceRoot)Microsoft\Data\ProviderBase\TimeoutTimer.cs">
<Link>Microsoft\Data\ProviderBase\TimeoutTimer.cs</Link>
</Compile>
<Compile Include="$(CommonSourceRoot)Microsoft\Data\SqlClient\SSPI\ManagedSSPIContextProvider.cs">
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these files not used in .NET Framework?

Copy link
Contributor Author

@MichelZ MichelZ Nov 8, 2024

Choose a reason for hiding this comment

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

That is the #IF NET6_0 file... so while it was referenced, it was not compiled for netfx

@@ -9,9 +9,8 @@ internal static partial class Libraries
internal const string Kernel32 = "kernel32.dll";
internal const string NtDll = "ntdll.dll";
#if !NET8_0_OR_GREATER
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this left in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests use that in multiple locations in SecurityWrapper.cs

[DllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, EntryPoint = "AcquireCredentialsHandleW")]

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.50%. Comparing base (c69f750) to head (caf7f16).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2991      +/-   ##
==========================================
+ Coverage   72.47%   72.50%   +0.02%     
==========================================
  Files         288      288              
  Lines       59498    59498              
==========================================
+ Hits        43124    43141      +17     
+ Misses      16374    16357      -17     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 75.45% <ø> (+0.03%) ⬆️
netfx 70.94% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichelZ MichelZ reopened this Nov 12, 2024
Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Hot dang! I love these kinds of changes! My only complaint is you stole all the fun from me :P

@benrr101 benrr101 added the ➕ Code Health Issues/PRs that are targeted to source code quality improvements. label Nov 14, 2024
Copy link
Member

@cheenamalhotra cheenamalhotra left a comment

Choose a reason for hiding this comment

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

Thanks @MichelZ
LGTM!

@cheenamalhotra cheenamalhotra added this to the 6.0-preview3 milestone Nov 14, 2024
@benrr101 benrr101 merged commit 7ec6310 into dotnet:main Nov 14, 2024
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
➕ Code Health Issues/PRs that are targeted to source code quality improvements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants