Skip to content

VersionUtils.IsNetCore returns false in net 5.0, breaking LoadAssemblyInPsesLoadContext #1317

Closed
@SeeminglyScience

Description

@SeeminglyScience

The check for .NET core is implemented as this:

public static bool IsNetCore { get; } = RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal);

But in .NET 5.0 the framework description no longer includes the word "Core". For example, in pwsh 7.1 preview 3, this is the framework description:

.NET 5.0.0-preview.4.20251.6

This makes EditorExtensionServiceProvider.LoadAssemblyInPsesLoadContext load the specified assembly in the default ALC, breaking ESCS:

public Assembly LoadAssemblyInPsesLoadContext(string assemblyPath)
{
        if (!VersionUtils.IsNetCore)
        {
                return Assembly.LoadFrom(assemblyPath);
        }
        return EditorExtensionServiceProvider.LoadAssemblyInPsesAlc(assemblyPath);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions