dotnet / dotnet/msbuild

[Feature Request]: A Task to read a JSON value or array of values into an Item/Item list

Open
#9,317 9 comments 2 reactions 0 assignees View on GitHub
backlog Feature Request needs-design Priority:3 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Summary

It's very common for various CLI tools or HTTP endpoints to represent structured data as JSON, which is part of the reason that MSBuild added a JSON output option for the 17.8 release. We should lean into this and support easier ingestion of JSON payloads as MSBuild items. Something like:

### Background and Motivation

This would ease interop between other tools and MSBuild, making it easier to make integrations with other ecosystems.

### Proposed Feature

```xml






```

This target would read content like this:

```
[
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"APP_UID=1654",
"ASPNETCORE_HTTP_PORTS=8080",
"DOTNET_RUNNING_IN_CONTAINER=true",
"DOTNET_VERSION=8.0.0-rc.1.23419.4",
"ASPNET_VERSION=8.0.0-rc.1.23421.29",
"DOTNET_GENERATE_ASPNET_CERTIFICATE=false",
"DOTNET_NOLOGO=true",
"DOTNET_SDK_VERSION=8.0.100-rc.1.23463.5",
"DOTNET_USE_POLLING_FILE_WATCHER=true",
"NUGET_XMLDOC_MODE=skip",
"POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Debian-12"
]
```

and injest it as a series of `Items` from the array.

### Alternative Designs

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.