Skip to content

Add System.Text.Json and System.Memory as builtin implicit references #9367

Open
@am11

Description

@am11

To use (even a simplest) JSON serialization in inline tasks (UsingTask), today we are expected to specify two additional references:

  <UsingTask
    TaskName="JsonShenanigans"
    TaskFactory="RoslynCodeTaskFactory"
    AssemblyName="Microsoft.Build.Tasks.Core">
    <Task>
      <Reference Include="System.Text.Json"/>
      <Reference Include="System.Memory"/>
      <Using ...

It would be nice to not require specifying these two references by promoting S.T.J assembly as a first-class citizen of RoslynCodeTaskFactory-based UsingTask.

ps - perhaps the entire set of current Microsoft.NETCore.App / Shared Framework references can be available implicitly in this scope if it does not violate any design principle? Requiring user to only specify <Using Namespace=".." /> to use anything out of SFX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.help wantedIssues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim.triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions