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

Merge | Pull in the rest of the interop files #2933

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

benrr101
Copy link
Contributor

Description: This PR is pretty straightforward, it brings in the rest of the files used for "interop". This is the first stage of a series of PRs that I've been working on that migrate the interop class to an interop namespace. This is a prerequisite for a prerequisite for merging LocalDBAPI. It is not strictly required, but it will make my life easier for merging the LocalDBAPI, and ideally it is work that should be done eventually anyhow.

Keep in mind if #2927 goes through, much of this code can be deleted since it is no longer needed in net8 or above.

This PR only moves the files, it does not make any code changes.

Testing: Projects still build, so there is no issue.

@benrr101
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -2,16 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if DEBUG && !NET8_0_OR_GREATER
#if DEBUG && !NETFRAMEWORK && !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.

Suggested change
#if DEBUG && !NETFRAMEWORK && !NET8_0_OR_GREATER
#if DEBUG && NET6_0

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it communicates the intent a bit better, but up to you. We'll delete them soon anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My rationale for using !NET8_0_OR_GREATER is because covers all versions below net8. I know we only build net6 and net8, and I guess it would be silly for someone to pull down the source and try to build it for eg, net7, but this is a fairly benign way to cover more bases.

I think of it similar to how we could do string.IndexOf("foo") == -1 or we could do string.IndexOf("foo") < 0, and how the latter is generally thought to be safer.

@edwardneal
Copy link
Contributor

This looks good to me.

On a more general note, it looks like we're moving away from the various NativeMethods, SafeNativeMethods and UnsafeNativeMethods classes? If so my PR #2828 removes the currently-unused PInvokes from these code files, so there's no need to bother migrating those. There are quite a few other PInvokes in those files which are only used within the SQLDebugging class (and associated debugging infrastructure) though. I'd suggest ignoring those too - SQLDebugging is only used when debugging a client application connected to a local SQL 2000 instance, and when this is no longer permitted I'm planning to submit a PR which will eliminate that functionality and remove these PInvokes anyway.

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.

3 participants