Skip to content

Log runtime mode acquired #8207

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
IDotnetFindPathContext,
} from './dotnetRuntimeExtensionApi';
import { DotNetRuntimeExtensionId } from '../../checkDotNetRuntimeExtensionVersion';
import { getCSharpDevKit } from '../../utils/getCSharpDevKit';

const DotNetMajorVersion = '9';
const DotNetMinorVersion = '0';
Expand All @@ -36,7 +35,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
* This is a function instead of a string because the server path can change while the extension is active (when the option changes).
*/
private getServerPath: (platform: PlatformInformation) => string,
private channel: vscode.OutputChannel,
private channel: vscode.LogOutputChannel,
private extensionPath: string
) {}

Expand All @@ -47,11 +46,12 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
return this.hostInfo;
}

const usingDevkit = getCSharpDevKit() !== undefined;
//const usingDevkit = getCSharpDevKit() !== undefined;
// If we're using devkit, acquire aspnetcore as well - this avoids two separate acquisitions (devkit requires aspnetcore).
const runtimeMode: DotnetInstallMode = usingDevkit ? 'aspnetcore' : 'runtime';
//const runtimeMode: DotnetInstallMode = usingDevkit ? 'aspnetcore' : 'runtime';
const runtimeMode = 'runtime';

this.channel.appendLine(`Locating .NET runtime version ${DotNetRuntimeVersion}`);
this.channel.info(`Locating .NET runtime version ${DotNetRuntimeVersion} with mode ${runtimeMode}`);
const extensionArchitecture = (await this.getArchitectureFromTargetPlatform()) ?? process.arch;
const findPathRequest: IDotnetFindPathContext = {
acquireContext: {
Expand All @@ -69,7 +69,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
findPathRequest
);
if (acquireResult === undefined) {
this.channel.appendLine(
this.channel.info(
`Did not find .NET ${DotNetRuntimeVersion} on path, falling back to acquire runtime via ${DotNetRuntimeExtensionId}`
);
acquireResult = await this.acquireDotNetProcessDependencies(runtimeMode);
Expand Down Expand Up @@ -158,7 +158,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
const vsixManifestFile = path.join(this.extensionPath, '.vsixmanifest');
if (!existsSync(vsixManifestFile)) {
// This is not an error as normal development F5 builds do not generate a .vsixmanifest file.
this.channel.appendLine(
this.channel.warn(
`Unable to find extension target platform - no vsix manifest file exists at ${vsixManifestFile}`
);
return undefined;
Expand Down
Loading