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

Use the .NET runtime extension to find an appropriate .NET install #7684

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dibarbet
Copy link
Member

C# extension side of microsoft/vscode-dotnettools#1243

Switches from our custom dotnet resolution to call the .net install tool API. Also ensures that a high enough version of the install tool exists.

@dibarbet dibarbet requested review from a team as code owners October 23, 2024 02:19
env: this.getEnvironmentVariables(dotnetPath),
};
let dotnetExecutablePath: string;
if (commonOptions.dotnetPath) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this should be deprecated in favor of the options on the .net install tool side. However I plan to tackle that in a separate PR as we'll need to separate out the O# usage of this option.

},
versionSpecRequirement: 'greater_than_or_equal',
};
const result = await vscode.commands.executeCommand<string>('dotnet.findPath', findPathRequest);
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It can return an IDotnetAcquireResult if the existingDotnetPath is set. It should always return an IDotnetAcquireResult. This was a mistake on my part, thank you for bringing this to my attention. I will make a fix.

src/main.ts Outdated Show resolved Hide resolved
@@ -83,6 +84,35 @@ export async function activate(
requiredPackageIds.push('OmniSharp');
}

const dotnetRuntimeExtensionId = 'ms-dotnettools.vscode-dotnet-runtime';
const requiredDotnetRuntimeExtensionVersion = '2.2.1';
Copy link
Member

Choose a reason for hiding this comment

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

Too bad this can't be expressed in the package.json

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, unfortunately no versions in extension dependencies :(

@dibarbet
Copy link
Member Author

converting to draft - there is one slight modification to the API coming in version 2.2.2 to consistently return a IDotnetAcquireResult instead of just a string. Will update this PR once it is available.

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