Skip to content

Replace hardcoded .net assembly references with DependencyContext-based resolution #369

@mzorec

Description

@mzorec

ScriptLoader.GetDefaultReferences() hardcodes ~40 individual System.* assembly references for Roslyn script compilation. When a user's build script needs an assembly not in this
list, it fails with cryptic CS0012/CS0246 compilation errors.

Use DependencyContext.Default.CompileLibraries to resolve compile-time references from the host application's .deps.json at runtime. This gives the full set of framework references the host was compiled against, without hardcoding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions